Handbook
Glossary
(simplest) ( n d n' d' -- val )
Vocabulary
math
.
approx
.
private
Inputs
n
an
object
d
an
object
n'
an
object
d'
an
object
Outputs
val
an
object
Definition
USING:
combinators
kernel
math
;
IN:
math.approx.private
::
(simplest)
( n d n' d' -- val )
n d
/mod
:>
( q r ) n' d'
/mod
:>
( q' r' )
{
{
[
r
zero?
]
[
q
]
}
{
[
q q'
=
not
]
[
q 1
+
]
}
[
d' r' d r
(simplest)
>fraction
:>
( n'' d'' ) q n''
*
d''
+
n''
/
]
}
cond
;