Handbook
Glossary
interval-min ( i1 i2 -- i3 )
Factor handbook
»
The language
»
Numbers
»
Intervals
»
Interval arithmetic
Prev:
interval-rem ( i1 i2 -- i3 )
Next:
interval-max ( i1 i2 -- i3 )
Vocabulary
math
.
intervals
Inputs
i1
an
interval
i2
an
interval
Outputs
i3
an
interval
Word description
Outputs the interval values obtained by lifting the
min
word to
i1
and
i2
.
Definition
USING:
accessors
combinators
kernel
math.order
sequences
;
IN:
math.intervals
:
interval-min
( i1 i2 -- i3 )
{
{
[
over
empty-interval?
]
[
drop
]
}
{
[
dup
empty-interval?
]
[
nip
]
}
{
[
2dup
[
full-interval?
]
both?
]
[
drop
]
}
{
[
over
full-interval?
]
[
nip
to>>
first
[-inf,b]
]
}
{
[
dup
full-interval?
]
[
drop
to>>
first
[-inf,b]
]
}
[
[
interval-closure
]
bi@
[
min
]
interval-op
nan-not-ok
]
}
cond
;