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

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

Graham Barr
February 17, 2001 13:17
Re: IV preservation (was Re: [PATCH 5.7.0] compiling on OS/2)
Message ID:
On Sat, Feb 17, 2001 at 02:57:35PM -0500, Ilya Zakharevich wrote:
> 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?

I may be jumping in at a bad point in this thread as I have not
followed it all. But Convert::ASN has to do just this and it does
it using frexp and then calling modf() repeatedly while multiplying
the mantissa.

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