develooper Front page | perl.vmsperl | Postings from June 2002

Re: [PATCH] pp.c:pp_pow() -- quit when you're done

Thread Previous | Thread Next
From:
Philip Newton
Date:
June 16, 2002 07:08
Subject:
Re: [PATCH] pp.c:pp_pow() -- quit when you're done
Message ID:
3o6pgu0gu1q8h74gjd0hsn5k05p58f2mhi@4ax.com
On Sun, 16 Jun 2002 12:45:30 +0100, nick@unfortu.net (Nicholas Clark)
wrote:

> For information (which I don't think has reached p5p) the reason for having
> messy loops in pp_pow rather than using pow() or log(), exp() and a multiply
> is that on Irix with longdoubles, 2**31 was giving a floating point value
> slightly *less* than 1<<31, which was really screwing up some tests.
> (and by implication (nearly) every perl programmer's assumption that 2**n
> is an integer)

Perhaps it had the same floating-point engine as my first "scientific"
calculator, for which 2**32 was 4294967295 (i.e. one less than the
correct answer).

Cheers,
Philip

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About