Handbook
Glossary
interval-log2 ( i1 -- i2 )
Factor handbook
»
The language
»
Numbers
»
Intervals
»
Interval arithmetic
Prev:
interval-abs ( i1 -- i2 )
Vocabulary
math
.
intervals
Inputs
i1
an
interval
Outputs
i2
an
interval
Word description
Integer-valued Base-2 logarithm of an interval.
Examples
USING: math.intervals prettyprint ; 20 32 [a,b] interval-log2 .
T{ interval { from { 0 t } } { to { 5 t } } }
Definition
IN:
math.intervals
GENERIC:
interval-log2
( i1 -- i2 )
Methods
USING:
math.intervals
;
M:
empty-interval
interval-log2
;
USING:
kernel
math.intervals
;
M:
full-interval
interval-log2
drop
[0,inf]
;
USING:
accessors
kernel
layouts
math
math.intervals
math.order
sequences
;
M:
interval
interval-log2
to>>
first
1
max
dup
most-positive-fixnum
>
[
drop
full-interval
interval-log2
]
[
1
+
>integer
log2
[0,b]
]
if
;