Category talk:Wren-i64: Difference between revisions

→‎Source code (Wren): Removed the previous limitation on the U64.isPrime method.
(→‎Source code (Wren): Removed the previous limitation on the U64.isPrime method.)
Line 623:
 
// Returns true if 'x' is prime, false otherwise.
// Fails due to overflow on numbers > 9223372036854775807 unless divisible by 2,3 or 5.
static isPrime(x) {
if (!(x is U64)) x = from(x)
var isbp = isBasicPrime_(x)
if (isbp != null) return isbp
if (x > largest/two) Fiber.abort("Cannot test %(x) for primality.")
var a
if (x < 2047) {
9,482

edits