Arthur Besse@lemmy.ml to Programmer Humor@lemmy.mlEnglish · edit-28 days agoIncredible stochastic algorithm, gets more reliable the larger your input, incredibly fast, trivial to implement and deterministic on its inputsimagemessage-square34linkfedilinkarrow-up1373arrow-down17file-text
arrow-up1366arrow-down1imageIncredible stochastic algorithm, gets more reliable the larger your input, incredibly fast, trivial to implement and deterministic on its inputsArthur Besse@lemmy.ml to Programmer Humor@lemmy.mlEnglish · edit-28 days agomessage-square34linkfedilinkfile-text
cross-posted from: https://lemmy.blahaj.zone/post/38950495 https://cosocial.ca/@mhoye/116111505546606451
minus-squaresepiroth154@feddit.nllinkfedilinkarrow-up23·edit-28 days agoYou could simplify it even further by removing the int x parameter of the function…
minus-squareneedanke@feddit.orglinkfedilinkarrow-up3·5 days agoEven better, do the work at compile time to respect the customers resources: const bool isPrime = false
minus-squaresepiroth154@feddit.nllinkfedilinkarrow-up3·5 days agoMy gosh, you always feel so stupid when someone points out something so obvious! Thanks
minus-squareobelisk_complex@piefed.calinkfedilinkEnglisharrow-up15arrow-down1·8 days agoSo elegant! This is too valuable for GitHub, sell this directly to the Saudi government.
You could simplify it even further by removing the int x parameter of the function…
Even better, do the work at compile time to respect the customers resources:
const bool isPrime = falseMy gosh, you always feel so stupid when someone points out something so obvious! Thanks
So elegant! This is too valuable for GitHub, sell this directly to the Saudi government.