Re: ncl strange calculation problem

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 17 2013 - 11:19:56 MST

This doesn't really answer your question, but I'll note:

- my calculator returns "-E-"
- C/C++/Java all return NaN
- Python returns the same result as your calculator

The man-page on C/C++'s "pow()" function state:

   pow(x,y)
   ..
   A domain error occurs if x is finite and negative and y is finite and not an integer.

(under MacOSX; similar verbage under Linux)

Ncl undoubtably uses the pow() for its computation.

On Dec 17, 2013, at 7:00 AM, sk <sdk0084@yahoo.com> wrote:

> in ncl:
> print(-17.8^0.4)
> (0) nan
>
> in standard calculator the result is: -3.163501181
> some explanation?
>
> Thx!
> -SK
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Dec 17 11:20:08 2013

This archive was generated by hypermail 2.1.8 : Wed Dec 18 2013 - 14:29:51 MST