Handbook
Glossary
marked-prime? ( n sieve -- ? )
Vocabulary
math
.
primes
.
erato
Inputs
n
an
integer
sieve
a
byte-array
Outputs
?
a
boolean
Word description
Checks whether
n
has been marked as a prime number.
sieve
must be a
byte-array
returned by
sieve
.
n
must be between 2 and the limit given to
sieve
.
Definition
USING:
kernel
math
math.order
math.primes.erato.private
sequences
;
IN:
math.primes.erato
:
marked-prime?
( n sieve -- ? )
[
integer>fixnum-strict
]
dip
2dup
upper-bound
2
swap
between?
[
bounds-error
]
unless
over
{
2 3 5
}
member?
[
2drop
t
]
[
marked-unsafe?
]
if
;