• A_Very_Big_Fan@lemmy.world
    link
    fedilink
    English
    arrow-up
    24
    arrow-down
    1
    ·
    10 months ago

    It’s been a fat minute since I last did any programming outside of batch scripts and AHK… I’m struggling to understand how it’s not returning false for 100% of the tests

    • RAM@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      47
      ·
      edit-2
      10 months ago

      It is always returning false, but the screen shows a test, where a non-prime evaluating as false is a pass and a prime evaluating as false is a fail :))

    • Troublehelix@feddit.nu
      link
      fedilink
      English
      arrow-up
      26
      ·
      10 months ago

      The output shown is the result of a test for the function, not the result of the function itself.

    • JackGreenEarth@lemm.ee
      link
      fedilink
      English
      arrow-up
      14
      ·
      10 months ago

      It’s returning false for all the tests, but it only should be returning false for 95% of them, as 5% are prime.