|  3DSoftware.com > Programming > Floating Point > Page 5 |
|
Floating Point Numbers
Page 5
Wide Floating Point Digit Ordering In a WideFloat number, each digit is Assume the digit packets of a wide number are declared as follows in |
||||||||||||
|
||||||||||||
|
For a WideInteger, d[0] would be the least significant digit, and d[5] the most significant digit. For a WideFloat, d[0] would be the most significant digit, and d[5] the least significant digit. For WideInteger these digits are to the left of the radix point in reverse For WideFloat the first digit is to the left of the radix point, with the remaining digits following in sequence after the radix In the following examples on this page, all digit packets that are not specified are assumed to be zero. |
||||||||||||
|
The number 0x200000030000004 is stored in a WideInteger as: |
||||||||||||
|
||||||||||||
|
That same number is stored in a WideFloat as: |
||||||||||||
|
||||||||||||
|
The WideFloat exponent will be 2, indicating that the radix point is two digit positions to the right compared to a standard normalized significand of |
||||||||||||
|
To store the number 1.0 in a WideFloat: |
||||||||||||
|
||||||||||||
|
The exponent will be 0. The significand is already in normal form in which the radix point is assumed to be between |
||||||||||||
|
Next we will store the number 1.5. That is 1½, which is |
||||||||||||
|
||||||||||||
|
The exponent will be 0. The significand is already in normal form. To understand why d[1] is 0x20000000, consider the polynomial with |
||||||||||||
|
||||||||||||
|
Now we will store the number 0.5, which is |
||||||||||||
|
||||||||||||
|
The exponent will be 1, indicating that the radix point must move one digit position to the left compared to the standard normalized significand of |
| Page 5 | ||||||
|
|
Copyright © 2008 by 3D Software. All rights reserved. 3D Software, P.O. Box 221190, Sacramento CA 95822 USA www.3DSoftware.com Contact us |
| Thursday, 20-Nov-2008 11:53:49 GMT |