EXPONENT(<expN>)
Evaluates the memory representation of <expN>.
Returns the power of 2 used to represent <expN>, or zero if <expN> is zero.

Useful for tracing numeric accuracy problems due to rounding
of floating-point representation.

Clipper represents floating-point numbers in an 8-byte (64-bit) format.
The bits are used as follows:

Bit 63: sign of the number (0 = positive, 1 = negative)
Bits 62-52: exponent of the number plus 1023 (i.e., highest power
of 2 smaller than the number)
Bits 51-0: mantissa of the number (i.e., binary digits to the
right of the binary point). The integer bit to the
left of the binary point is implied, and is always
assumed to be 1.

* Evaluate power of 2 used to represent 100.
? EXPONENT( 100 ) && returns 6

The formula is MANTISSA( <expN> ) * 2(EXPONENT( <expN> )) = <expN>


Placed in the Public Domain by Tom Rettig Assoc.