Keil Logo

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+0 Address+1 Address+2 Address+3
Contents SEEE EEEE EMMM MMMM MMMM MMMM MMMM MMMM


  Address+4 Address+5 Address+6 Address+7
Contents MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM

Where

S represents the sign bit where 1 is negative and 0 is positive.
E is the exponent with an offset of 1023.
M is the 53-bit normal mantissa. The highest bit is always 1 and, therefore, is not stored.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.