478
you are viewing a single comment's thread
view the rest of the comments
[-] A_Very_Big_Fan@lemmy.world 23 points 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 49 points 10 months ago* (last edited 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 26 points 10 months ago

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

[-] A_Very_Big_Fan@lemmy.world 11 points 10 months ago

Ooooh I see lol. Thank you!

[-] JackGreenEarth@lemm.ee 14 points 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.

this post was submitted on 22 Jan 2024
478 points (98.6% liked)

Science Memes

11189 readers
3077 users here now

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don't throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

founded 2 years ago
MODERATORS