Re: ncl strange calculation problem

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 17 2013 - 11:24:54 MST

Also

ncl 0> x = 17.8^0.4
ncl 1> print(x)

Variable: x
Type: float
Total Size: 4 bytes
             1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 3.163501

ncl 2> print(-(17.8^0.4))

(0) -3.163501

On 12/17/13, 11:19 AM, Rick Brownrigg wrote:
> 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
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Dec 17 11:25:05 2013

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