unreachable.cloud
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Arthur Besse@lemmy.ml to Programmer Humor@lemmy.mlEnglish ·
edit-2
5 hours ago

Incredible stochastic algorithm, gets more reliable the larger your input, incredibly fast, trivial to implement and deterministic on its inputs

lemmy.ml

message-square
18
fedilink
228

Incredible stochastic algorithm, gets more reliable the larger your input, incredibly fast, trivial to implement and deterministic on its inputs

lemmy.ml

Arthur Besse@lemmy.ml to Programmer Humor@lemmy.mlEnglish ·
edit-2
5 hours ago
message-square
18
fedilink

cross-posted from: https://lemmy.blahaj.zone/post/38950495

https://cosocial.ca/@mhoye/116111505546606451

  • /home/pineapplelover@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    2 hours ago

    I’m confused, shouldn’t this be printing false no matter what the input is?

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      1
      ·
      19 minutes ago

      The test suite probably looks something like this:

      int tests_passed=0;
      int tests_failed=0;
      for(int i=0;i<100000;i++){
          printf("test no. %d: ", i);
          if(is_prime(i)==actually_is_prime(i)){
              printf("passed\n");
              tests_passed++;
          }else{
              printf("failed\n");
              tests_failed++;
          }
      }
      //...
      
    • Carl [he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      7
      ·
      edit-2
      2 hours ago

      that’s the joke, since most numbers aren’t prime, this function is technically highly accurate despite being completely useless.

    • fallaciousBasis@lemmy.world
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      2 hours ago

      Removed by mod

      • Ænima@lemmy.zip
        link
        fedilink
        arrow-up
        2
        ·
        2 hours ago

        Removed by mod

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 372 users / day
  • 972 users / week
  • 1.79K users / month
  • 6.06K users / 6 months
  • 1 local subscriber
  • 41.1K subscribers
  • 1.73K Posts
  • 28.7K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org