Interval arithmetic
Factor handbook » The language » Numbers » Intervals

Prev:Creating intervals
Next:Set-theoretic operations on intervals


In general, a binary operation X Y op where X and Y are intervals is the set {x op y forall x in X, y in Y}.

Binary operations on intervals:
interval+ ( i1 i2 -- i3 )

interval- ( i1 i2 -- i3 )

interval* ( i1 i2 -- i3 )

interval/ ( i1 i2 -- i3 )

interval/i ( i1 i2 -- i3 )

interval-mod ( i1 i2 -- i3 )

interval-rem ( i1 i2 -- i3 )

interval-min ( i1 i2 -- i3 )

interval-max ( i1 i2 -- i3 )


Bitwise operations on intervals:
interval-shift ( i1 i2 -- i3 )

interval-bitand ( i1 i2 -- i3 )

interval-bitor ( i1 i2 -- i3 )

interval-bitxor ( i1 i2 -- i3 )


Unary operations on intervals:
interval-1+ ( i1 -- i2 )

interval-1- ( i1 -- i2 )

interval-neg ( i1 -- i2 )

interval-bitnot ( i1 -- i2 )

interval-recip ( i1 -- i2 )

interval-2/ ( i1 -- i2 )

interval-abs ( i1 -- i2 )

interval-log2 ( i1 -- i2 )