Handbook
Glossary
reduce-odds ( value u v -- value' u' v' )
Vocabulary
math
.
extras
.
private
Inputs
value
an
object
u
an
object
v
an
object
Outputs
value'
an
object
u'
an
object
v'
an
object
Definition
USING:
combinators
kernel
math
math.order
;
IN:
math.extras.private
:
reduce-odds
( value u v -- value' u' v' )
[
[
[
dup
even?
]
[
2/
]
while
]
bi@
2dup
<=>
{
{
+eq+
[
over
[
*
]
curry
2dip
f
]
}
{
+lt+
[
swap
[
-
]
keep
t
]
}
{
+gt+
[
[
-
]
keep
t
]
}
}
case
]
loop
;