Re: A92: Questions about the floats
[Prev][Next][Index][Thread]
Re: A92: Questions about the floats
At 11:07 1998-06-09 +0200, you wrote:
>
>How can I convert a given floatnumber into the 32bit format (FFP format)? It
>isn't described in the documentation. I want to have this information,
>because I want to include it in our Fargocompiler and I want to use only the
>32bit format, because that is the smallest format of float numbers
>From what I can tell, the FFP format is identical to the IEEE floating
point standard, with some differences (probably for speed reasons):
The higher 24 bits (3 bytes) are used as mantissa, and does NOT assume a
leading 1 (IEEE assumes that all numbers are 1.xxxxx, binary). In the
remaining 8 bits (the lowest byte), bit 7 is the sign bit, and bits 0-6 are
the exponent, with zero coded as 64 (1000000).
A little easier:
Bits 0-6: Exponent with zero at 64.
Bit 7: Sign.
Bits 8-31: Mantissa without leading one.
Anyone got that?
Niklas Brunlid - http://www.efd.lth.se/~e96nbr
PQF Quote follows:
The Emperor had all the qualifications for a corpse except, as it were, the
most vital one.
-- (Terry Pratchett, Interesting Times)
References: