4.1 Numbers in General

The module Number contains procedures operating on numbers. Numbers in Oz are either integers or floats. The following arithmetic procedures are defined both on integers and on floats; however, there is no implicit conversion. If one input argument is a float and the other an integer, a type error is raised.


{Number.is +X ?B}

tests whether X is a number.


{Number.'+' +FI1 +FI2 ?FI3}

returns the sum of FI1 and FI2.


{Number.'-' +FI1 +FI2 ?FI3}

returns the difference of FI1 and FI2.


{Number.'*' +FI1 +FI2 ?FI3}

returns the product of FI1 and FI2.


{Number.'~' +FI1 ?FI2}

returns the negation of FI1.


{Number.pow +FI1 +FI2 ?FI3}

returns FI1 to the power of FI2.


{Number.abs +FI1 ?FI2}

returns the absolute value of FI1.

Denys Duchier, Leif Kornstaedt and Christian Schulte
Version 1.4.0 (20080702)