4 ms·
To be fair, that's the correct answer if you're trying to do a primality test for some non-didactic reason. They're complicated. There are very simple ways to
by thaumasiotes 8y ago
To be fair, that's the correct answer if you're trying to do a primality test for some non-didactic reason. They're complicated.
There are very simple ways to test for primality, but they're... slow. (And at that level, the "in Java" part of the question doesn't make any sense. "What cryptography libraries do you use in Java?" is a perfectly sensible question. "How do you divide numbers in Java?"....)
- deleted 8y ago[deleted]