Re: FastCode RoundToEx



"Rudy Velthuis [TeamB]" <newsgroups@xxxxxxxxxxxx> wrote
What is actually stored for the Extended type?

Extended: Sign (1 bit), Exponent (15 bits), Mantissa (64 bits)
Double: Sign (1 bit), Exponent (11 bits), Mantissa (52 bits)
Single: Sign (1 bit), Exponent ( 8 bits), Mantissa (23 bits)
All stored on Intel machines in little endian format.
The most significant bit (MSB) of what we are calling the "mantissa" is not stored in the single and double types (because it is assumed to be set true for normal numbers), but it is stored in the extended type (because, I presume, the designers were not concerned about saving space in the extended type). For the very small, so called denormalized, values, the MSB is stored for all three number types.

From Stephen P Morse's "The 80386/387 Architecture" book:
As an example, the single-precision number that is represented by:
1 01111110 11000000000000000000000
has s = 1, E = 126, f1 = 1, and f2 = 1. Thus the value is
(-1)^1 * (1.11(base 2)) * 2^(126-127) = -1 * 1.75 * 2^1 = -8.75

--JohnH
.



Relevant Pages

  • Re: BigNum -- Floating Point
    ... > mantissa and exponent. ... In that the current implementation already uses 32-bit "digits", ... (in one design I'm considering) ...
    (comp.programming)
  • Re: Fixed-point Math help
    ... > suggestion of using google is probably a good one. ... > can be packed in any format you like or is convenient to you. ... but it is usually assumed for the mantissa at any convenient ... > values of the exponent. ...
    (comp.arch.embedded)
  • A Collating Representation for Extremely Gradual Overflow
    ... the binary point does not move as the exponent changes from 000...001 to ... the first part of the mantissa, whether it is 1, 01, or 001, before the ... After I thought of a further improvement, letting the exponent field ... This extremely gradual underflow representation does more than regular ...
    (comp.arch.arithmetic)
  • Re: floating point mantissa?
    ... optimized normalization, denormalization methods. ... > IMHO 146 cycles just for a normalization of a single floating point number ... shift the mantissa left a bit (and decrement the exponent) ...
    (microsoft.public.vc.language)
  • Re: QI and MQ Coder: First real-life experiences
    ... > is used to align the mantissa? ... If you look at SWI as a floating point number, ... So for that concept of "precision", ... The SW exponent, of course, as shown e.g. in EncDec.c, function ...
    (comp.compression)