Documentation
Arithmetic

Meta-data
 Authors: Slava Pestov

Words

Builtin classes
 bignum fixnum float

Tuple classes
 Class Superclass Slots complex tuple real imaginary log2-expects-positive tuple x ratio tuple numerator denominator

Union classes
 integer number rational real

Generic words
 Word Stack effect * ( x y -- z ) + ( x y -- z ) - ( x y -- z ) / ( x y -- z ) /f ( x y -- z ) /i ( x y -- z ) /mod ( x y -- z w ) < ( x y -- ? ) <= ( x y -- ? ) > ( x y -- ? ) >= ( x y -- ? ) >bignum ( x -- n ) >fixnum ( x -- n ) >float ( x -- y ) >fraction ( a/b -- a b ) >integer ( x -- n ) >rect ( z -- x y ) abs ( x -- y ) bit? ( x n -- ? ) bitand ( x y -- z ) bitnot ( x -- y ) bitor ( x y -- z ) bitxor ( x y -- z ) denominator ( a/b -- b ) fp-infinity? ( x -- ? ) fp-nan-payload ( x -- bits ) fp-nan? ( x -- ? ) fp-qnan? ( x -- ? ) fp-sign ( x -- ? ) fp-snan? ( x -- ? ) fp-special? ( x -- ? ) imaginary-part ( z -- y ) integer>fixnum ( x -- y ) integer>fixnum-strict ( x -- y ) mod ( x y -- z ) neg? ( x -- ? ) next-float ( m -- n ) number= ( x y -- ? ) numerator ( a/b -- a ) prev-float ( m -- n ) real-part ( z -- x ) recip ( x -- y ) shift ( x n -- y ) simple-gcd ( x y -- d ) u< ( x y -- ? ) u<= ( x y -- ? ) u> ( x y -- ? ) u>= ( x y -- ? ) unordered? ( x y -- ? )

Primitives
 Word Stack effect bits>double ( n -- x ) bits>float ( n -- x ) double>bits ( x -- n ) float>bits ( x -- n )

Ordinary words
 Word Stack effect (all-integers?) ( ... i n quot: ( ... i -- ... ? ) -- ... ? ) (each-integer) ( ... i n quot: ( ... i -- ... ) -- ... ) (find-integer) ( ... i n quot: ( ... i -- ... ? ) -- ... i/f ) 2/ ( x -- y ) 2^ ( n -- 2^n ) ( payload -- nan ) ?1+ ( x -- y ) align ( m w -- n ) all-integers? ( ... n quot: ( ... i -- ... ? ) -- ... ? ) each-integer ( ... n quot: ( ... i -- ... ) -- ... ) even? ( n -- ? ) find-integer ( ... n quot: ( ... i -- ... ? ) -- ... i/f ) find-last-integer ( ... n quot: ( ... i -- ... ? ) -- ... i/f ) fp-bitwise= ( x y -- ? ) gcd ( x y -- a d ) if-zero ( ..a n quot1: ( ..a -- ..b ) quot2: ( ..a n -- ..b ) -- ..b ) log2 ( x -- n ) log2-expects-positive ( x -- * ) neg ( x -- -x ) next-power-of-2 ( m -- n ) odd? ( n -- ? ) power-of-2? ( n -- ? ) rect> ( x y -- z ) rem ( x y -- z ) sgn ( x -- n ) sq ( x -- y ) times ( ... n quot: ( ... -- ... ) -- ... ) unless-zero ( ... n quot: ( ... n -- ... ) -- ... ) when-zero ( ... n quot: ( ... -- ... x ) -- ... x ) zero? ( x -- ? )

Class predicate words
 Word Stack effect bignum? ( object -- ? ) complex? ( object -- ? ) fixnum? ( object -- ? ) float? ( object -- ? ) integer? ( object -- ? ) log2-expects-positive? ( object -- ? ) number? ( object -- ? ) ratio? ( object -- ? ) rational? ( object -- ? ) real? ( object -- ? )

Files

Children from resource:core
 Vocabulary Summary math.floats Floating point number implementation math.integers Integer implementation math.order Generic protocol for totally-ordered objects math.parser Converting numbers to and from strings math.ratios Rational number implementation

Children from resource:basis
 Vocabulary Summary math.bits Virtual sequence for bits of an integer math.bitwise Bitwise arithmetic utilities math.combinatorics Permutations and combinations math.complex Complex number implementation math.constants Mathematical constants math.floats Floating point number implementation math.functions Elementary complex-valued functions math.intervals Interval arithmetic math.libm Low-level binding to math functions in the C standard library math.matrices Matrix arithmetic math.partial-dispatch Partially-dispatched math operations, used by the compiler math.polynomials Polynomial arithmetic math.primes Prime numbers test and generation math.quaternions Quaternion arithmetic and Euler angles math.ranges Virtual sequence consisting of a range of numbers math.rectangles math.rectangles vocabulary math.statistics Mean, median, standard deviation, and other statistical routines math.vectors Vector arithmetic

Children from resource:extra
 Vocabulary Summary math.affine-transforms Affine transforms for two-dimensional vectors math.algebra Various algebra-related words math.analysis Various special functions from complex analysis math.approx Approximating rational numbers. math.binpack Bin-packing algorithms. math.blas math.blas vocabulary math.cardinality Cardinality estimation math.combinatorics Permutations and combinations math.combinators math.combinators vocabulary math.compare Comparison functions. math.continued-fractions Continued fractions math.derivatives math.derivatives vocabulary math.distances math.distances vocabulary math.dual math.dual vocabulary math.extras math.extras vocabulary math.factorials math.factorials vocabulary math.finance Moving averages and other calculations useful for finance. math.floating-point math.floating-point vocabulary math.function-tools math.function-tools vocabulary math.hashcodes math.hashcodes vocabulary math.matrices Matrix arithmetic math.numerical-integration Numerical integration using Simpson's method math.points math.points vocabulary math.primes Prime numbers test and generation math.quadratic Quadratic equation solver math.secant-method math.secant-method vocabulary math.similarity math.similarity vocabulary math.splines Common parametric curves math.text math.text vocabulary math.transforms math.transforms vocabulary math.trig math.trig vocabulary math.unicode math.unicode vocabulary math.vectors Vector arithmetic

Children
 Vocabulary Summary math.private math.private vocabulary