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

Re: [perl #20827] Unexpected scientific notation.

Thread Previous | Thread Next
Nicholas Clark
February 15, 2003 14:21
Re: [perl #20827] Unexpected scientific notation.
Message ID:
On Tue, Feb 11, 2003 at 05:19:49PM -0500, John Peacock wrote:
> Abigail wrote:

> >I most certainly do think it's a bug. The number to be squared was
> >carefully picked to be less than the square root of 0x7FFFFFFFFFFFFFFF.
> But the fact that _you_ know the exponent will fit doesn't easily translate 
> into Perl being able to forsee that.  I'll try and look at the core logic 
> when I get home.

It's documented in perlnumber.pod that

  Operators such as C<**>, C<sin> and C<exp> force arguments to floating point

and in perlop.pod:

    =head2 Exponentiation
    Binary "**" is the exponentiation operator.  It binds even more
    tightly than unary minus, so -2**4 is -(2**4), not (-2)**4. (This is
    implemented using C's pow(3) function, which actually works on doubles

Nicholas Clark

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