Login
Sign Up For Free
English
中文 (繁體)
中文 (香港)
中文 (简体)
日本語
Filipino
Bahasa Indonesia
Bahasa Melayu
Pусский
Português (Brasil)
Magyar
Français
Español
Deutsch
Čeština
العربية
Català
Dansk
Ελληνικά
فارسی
Suomi
Gaeilge
Hindi
עברית
Hrvatski
Italiano
Norsk bokmål
Nederlands
한국어
Polski
Română
Slovenský
Svenska
Türkçe
українська
беларуская
ไทย
Standard view
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
立即下載
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
Really cool! I just
confirmed that experimentally
!
SubStack
14 years ago
and
put it on the readme
Lemongrass
says
14 years ago
great! I'll be able to try that soon. node.js is building in the other window.
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
delete
reply
edit
cancel
cancel