SubStack
14 years ago
generates some large random primes
latest #22
SubStack
14 years ago
bigint(2).pow(159).add(1).rand(bigint(2).pow(160)).nextPrime()
SubStack
14 years ago
<BigInt 1324747699464051594045963950518480204962289461419>
Griffy.Lapin is
14 years ago
trying (in vain) to follow along :-P
立即下載
SubStack
14 years ago
from my bigint lib!
SubStack
14 years ago
which uses libgmp behind the scenes
Lemongrass likes
14 years ago
perfect numbers better. If 2^n-1is prime, then (2^n-1).2^(n-1) is perfect.
SubStack
14 years ago
just got prime number generation for DSS working!
SubStack
14 years ago
had to translate some crappy pseudocode with gotos to get to this point
SubStack
14 years ago
still better than most specs
SubStack
14 years ago
Lemongrass says
14 years ago
great! I'll be able to try that soon. node.js is building in the other window. (dance)
Lemongrass is
14 years ago
reading "JavaScript: The Good Parts" by Douglas Crockford at the moment.
Lemongrass asks
14 years ago
is substack can show whether that formula finds all the perfect numbers ;-)
SubStack
14 years ago
suspects that is one of those open problems
Lemongrass thinks
14 years ago
substack is only a bit right.
Lemongrass has
14 years ago
node.js built under Cygwin now (can't be bothered to use the Linux machine downstairs) but can't install bigint because there's no libffi.
SubStack
14 years ago
lemongrass Check out npm! You can just `npm install bigint` (you'll need libgmp installed separately though)
Lemongrass says
14 years ago
that's what he tried. Unfortunately bigint uses node-ffi which requires libffi to already be installed so npm bombs out.
Lemongrass says
14 years ago
Cygwin has no libffi. It's interesting that node-ffi exists actually, given that people are bound to use it to interface with blocking libs
Lemongrass
14 years ago
which would make Mr. Dahl rather upset ;-)
SubStack
14 years ago
ah makes sense
back to top