------- Comment #8 from sgk at troutmask dot apl dot washington dot edu  
2009-01-13 19:58 -------
Subject: Re:  Diagnose and treat (-2.0)**2.0 properly

On Tue, Jan 13, 2009 at 11:37:25AM -0000, dominiq at lps dot ens dot fr wrote:
> 
> 
> ------- Comment #3 from dominiq at lps dot ens dot fr  2009-01-13 11:37 
> -------
> > - Mathematica:
> >   -2^2 = 4, -2.0^2.0 = -4.0
> >   2.0^1.9 = -3.73213      <------- probably -2.0^1.9!
> 
> Apparently Mathematica parse "-2.0^a" as "-(2.0^a)". (-2.0)^1.9 gives 
> "3.54947-
> 1.15329 I". I don't know if the fortran standard says how "-a**b" should be
> parsed (nor have the time right now to decipher the legalese).
> 

See Note 7.30 in the Fortran 2003 Standard.

-a**b is parsed as if it were written as -(a**b).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38823

Reply via email to