fixed

the corba fixed type

This module contains functions that gives an interface to the CORBA fixed type.

The type Fixed used below is defined as:

-record(fixed, {digits, scale, value}).

where digits is the total amount of digits it consists of and
scale is the number of fractional digits. The value field
contains the actual Fixed value represented as an integer. The limitations
of each field are:

Since the Value part is represented by an integer, it is vital that the
Digits and Scale values are correct. This also means that trailing zeros
cannot be left out in some cases:

fixed<5,3> eq. 03.140d eq. 3140

fixed<3,2> eq. 3.14d eq. 314

Leading zeros can be left out.

For your convenience, this module exports functions which handle
unary (-) and binary (+-*/) operations legal for the Fixed type.
Since a unary + have no effect, this module do not export such a
function. Any of the binary operations may cause an overflow (i.e. more than
31 significant digits; leading and trailing zeros are not considered
significant). If this is the case, the Digit and Scale values are adjusted
and the Value truncated (no rounding performed). This behavior is
compliant with the OMG CORBA specification. Each binary operation have
the following upper bounds: