Handbook
Glossary
simplest ( x y -- val )
Vocabulary
math
.
approx
.
private
Inputs
x
an
object
y
an
object
Outputs
val
an
object
Definition
USING:
combinators
kernel
math
;
IN:
math.approx.private
::
simplest
( x y -- val )
{
{
[
x y
>
]
[
y x
simplest
]
}
{
[
x y
=
]
[
x
]
}
{
[
x 0
>
]
[
x y
[
>fraction
]
bi@
(simplest)
]
}
{
[
y 0
<
]
[
y x
[
neg
>fraction
]
bi@
(simplest)
neg
]
}
[
0
]
}
cond
;