Random prime number generator, N bits:
Gmp.mpz(Crypto.randomness.pike_random()->read(N/8),256)->next_prime();
/ Mirar
Previous text:
2003-02-25 11:57: Subject: Re: Do we have a floatingpoint bug?
No, it's not a subset. mpq is rational numbers; these will of course work the way you want it if you set q in p/q to something useful, like 1000000. mpf is a true floating point, and will work like floats in Pike.
It's more useful if you want to play with *floats* without having to worry about large numbers, for instance 1e(1e100) will work nicely in mpf, but not very nicely in mpq. :-)
Both mpq and mpf support seems limited, though. Neither of them have "pow".
there is a website where you can download a few megabytes worth of digits. though atm i am more interrested in an algorithm to generate prime numbers actually... (but thats another topic)
next_prime might be useful? :)
| > 42->next_prime(); | Result: 43
/ Mirar