Handbook
Glossary
write-factor ( n d -- n' d' )
Vocabulary
math
.
primes
.
brute-force
.
private
Inputs
n
an
object
d
an
object
Outputs
n'
an
object
d'
an
object
Definition
USING:
arrays
kernel
make
math.functions
math.primes
;
IN:
math.primes.brute-force.private
:
write-factor
( n d -- n' d' )
2dup
divisor?
[
[
[
count-factor
]
1check
2array
,
]
keep
over
prime?
[
drop
dup
]
when
]
when
;