not_IO@lemmy.blahaj.zonecake to Programmer Humor@programming.devEnglish · 10 months agoo(1) statistical prime approximationlemmy.blahaj.zoneimagemessage-square17linkfedilinkarrow-up1572arrow-down13file-text
arrow-up1569arrow-down1imageo(1) statistical prime approximationlemmy.blahaj.zonenot_IO@lemmy.blahaj.zonecake to Programmer Humor@programming.devEnglish · 10 months agomessage-square17linkfedilinkfile-text
minus-squarekraftpudding@lemmy.worldlinkfedilinkarrow-up25·10 months agoI suppose because about 5% of numbers are actually prime numbers, so false is not the output an algorithm checking for prime numbers should return
minus-squareJustARegularNerd@lemmy.dbzer0.comlinkfedilinkarrow-up6·10 months agoOh I’m with you, the tests are precalculated and expect a true to return on something like 99991, this function as expected returns false, which throws the test into a fail. Thank you for that explanation
minus-squareAgent641@lemmy.worldlinkfedilinkarrow-up3·10 months agoAnd the natural distribution of primes gets smaller as integer length increases
I suppose because about 5% of numbers are actually prime numbers, so false is not the output an algorithm checking for prime numbers should return
Oh I’m with you, the tests are precalculated and expect a true to return on something like 99991, this function as expected returns false, which throws the test into a fail.
Thank you for that explanation
And the natural distribution of primes gets smaller as integer length increases