Handbook
Glossary
step ( n cont-frac -- n cont-frac )
Vocabulary
project-euler
.
064
.
private
Inputs
n
an
object
cont-frac
an
object
Outputs
n
an
object
cont-frac
an
object
Definition
USING:
accessors
kernel
locals.backend
math
math.functions
;
IN:
project-euler.064.private
:
step
( n cont-frac -- n cont-frac )
swap
dup
load-local
swap
dup
num-const>>
load-local
0
get-local
2
^
-1
get-local
swap
-
load-local
dup
denom>>
0
get-local
simple-gcd
0
get-local
swap
/
load-local
-2
get-local
-3
get-local
sqrt
+
0
get-local
/
>fixnum
load-local
-3
get-local
-1
get-local
/
0
get-local
swap
-
-1
get-local
*
load-local
drop
-1
get-local
0
get-local
-2
get-local
<cont-frac>
6
drop-locals
;