Re: 0.0 ** 2 and pow(0.0,0.5) give different results

Louis Frayser (frayser@Earthlink.NET)
Wed, 23 Apr 1997 02:46:31 -0700 (PDT)


Thats intersting (SING), the HP manpage says SING (or NaN) is printed
whenever log(), log2(), or log10() are given 0.

Zero must be getting passed to one of the the log() functions.
There are some identies that probably reduce to taking the log of zero.

I'm running on Linux. The manual here only says that log(A) is
only valid for A > 0.

Thanks.

-Louis

--
On 23-Apr-97 "Jacek M. Holeczek" wrote:
>>> root [1] 0.0**2
>> (double)         NaN
>> root [2] (0.0)**2
>> (double)         NaN
>> root [3] pow(0.0,.5)
>> (double)0.000000000000e+00
>> root [4] 
>Which machine / os do you use ?
>On AIX 4.1 I get :
>------------------
>root [0] pow(0.0,.5)
>(double)0.000000000000e+00
>root [1] 0.0**2
>(double)0.000000000000e+00
>root [2] (0.0)**2
>(double)0.000000000000e+00
>------------------
>On HP-UX 9.1 I get :
>------------------
>root [0] pow(0.0,.5)
>(double)0.000000000000e+00
>root [1] 0.0**2
>log: SING error                              <-?
>(double)0.000000000000e+00
>root [2] (0.0)**2
>log: SING error                              <-?
>(double)0.000000000000e+00
>------------------
>Jacek.
>

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ _/ mailto:frayser@earthlink.net _/ LFrayser@msn.com _/ _/http://www.earthlink.net/~frayser _/ LFrayser@candle.com_/ _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/