develooper Front page | perl.perl5.porters | Postings from February 2001

Re: IV preservation (was Re: [PATCH 5.7.0] compiling on OS/2)

Ilya Zakharevich
February 17, 2001 11:57
Re: IV preservation (was Re: [PATCH 5.7.0] compiling on OS/2)
Message ID:
On Sat, Feb 17, 2001 at 05:14:25PM +0000, wrote:
> >>        The frexp() function is used to split the number x into  a
> >>        normalized  fraction  and  an  exponent which is stored in
> >>        exp.              
> >
> >I would not think that this has anything to do with the bitpattern
> >manipulations you described above.
> Sure it is.
> frexp() says extract the exponent and stuff it in the integer provided,
> then set the exponent to 0 and return the resulting double which is 
> now the fraction.

But you are back where you were: how do you extract the bitpattern
from the "normalized fraction" part?

> Strictly speaking true. But as "minimum" float and double ranges
> fit in exactly 32 and 64 bits respectively, with the 
> sign, exponent, (hidden MSB), mantissa as per IEEE then in practice the 
> only difference is big/little endian style ordering of the fields.

I have some vague recollections that it is not always as simple as
that, even with 32b and 64b IEEE...

Ilya Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About