Handbook
Glossary
points>interval ( seq -- interval nan? )
Factor handbook
»
The language
»
Numbers
»
Intervals
»
Creating intervals
Prev:
empty-interval
Vocabulary
math
.
intervals
Inputs
seq
a sequence of
{ point included? }
pairs
Outputs
interval
an
interval
nan?
true if the computation produced NaNs
Word description
Outputs the smallest interval containing all of the endpoints.
Definition
USING:
kernel
math
sequences
;
IN:
math.intervals
:
points>interval
( seq -- interval nan? )
[
first
fp-nan?
not
]
partition
[
[
[
]
[
endpoint-min
]
map-reduce
]
[
[
]
[
endpoint-max
]
map-reduce
]
bi
<interval>
]
[
empty?
not
]
bi*
;