bigint genbigint(int numbits) { bigint tmp; while (numbits --> 0) { tmp <<= 1; tmp += uniform(0, 2); } return tmp; }
Re: Primality test function doesn't work on large numbers?
Elronnd via Digitalmars-d-learn Mon, 09 Jan 2017 19:05:58 -0800
Thank you! Would you mind telling me what you changed aside from
pow() and powm()? diff isn't giving me readable results, since
there was some other stuff I trimmed out of the original file.
Also, while this is a *lot* better, I still get some lag
generating 1024-bit primes and I can't generate larger primes in
a reasonable amount of time. Maybe my genbigint() function is to
blame? It isn't efficient:
- Primality test function doesn't wor... Elronnd via Digitalmars-d-learn
- Re: Primality test function do... Eugene Wissner via Digitalmars-d-learn
- Re: Primality test function do... Timon Gehr via Digitalmars-d-learn
- Re: Primality test functio... Elronnd via Digitalmars-d-learn
- Re: Primality test fun... Eugene Wissner via Digitalmars-d-learn
- Re: Primality test fun... Timon Gehr via Digitalmars-d-learn