Category talk:Wren-i64: Difference between revisions
Content added Content deleted
(Added multinomial and binomial methods to U64 class.) |
(→Source code (Wren): Added U64.nextPrime method.) |
||
Line 547: | Line 547: | ||
} |
} |
||
return true |
return true |
||
} |
|||
// Returns the next prime number greater than 'x'. |
|||
static nextPrime(x) { |
|||
if (!(x is U64)) x = from(x) |
|||
x = x.isEven ? x + one : x + two |
|||
while (true) { |
|||
if (isPrime(x)) return x |
|||
x = x + two |
|||
} |
|||
} |
} |
||