C251 User's Guide

Double Numbers

Scalars of type double are stored using eight bytes (64 bits). Type double numbers have a precision of 53 bits, which represents about 13 decimal digits. The format used follows the IEEE-754 standard.

A double number is expressed as the product of two parts: the mantissa and the exponent. The mantissa stores the actual digits of the number. The exponent stores the power to which the mantissa must be raised. For example:

±mantissa × 2exponent

The mantissa represents the actual binary digits of the floating-point number.

The power of two is represented by the exponent. The stored form of the exponent is an 11-bit value from 0 to 2047. The actual value of the exponent is calculated by subtracting 1023 from the stored value (0 to 2047) giving a range of –1023 to +1024.

The mantissa is a 53-bit value (representing about seven decimal digits) whose most significant bit (MSB) is always 1 and is, therefore, not stored. There is also a sign bit that indicates whether the floating-point number is positive or negative.

Tyep double numbers are stored in memory on word boundaries in the following format:

 Address+0Address+1Address+2Address+3
ContentsSEEE EEEEEMMM MMMMMMMM MMMMMMMM MMMM


 Address+4Address+5Address+6Address+7
ContentsMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMM

Where

Srepresents the sign bit where 1 is negative and 0 is positive.
Eis the exponent with an offset of 1023.
Mis the 53-bit normal mantissa. The highest bit is always 1 and, therefore, is not stored.