Zero raised by zero

joerg.kunze
Posts: 33
Joined: 2009-09-22
Location: Germany

Hi,

0^0 yields 1. 0^0 should be equal to cmplx(0,0) because 0 = 0 + i*0, where i = cmplx(0,1). But print cmplx(0,0)^0 yields (Nan,Nan). I think, that is wrong. Is there any setting or pragma, that helps to get the correct result cmplx(0,0)^0 = (0 + i*0)^0 = 1?

Best regards,
Joerg


HJDrescher
Posts: 358
Joined: 2015-01-20
Location: Germany

In addition, NaN^0 yields 1. I'd have expected NaN as a result. Maybe this is related.

HJ


thomas_braun
Posts: 586
Joined: 2009-10-07
Location: Germany

@HJDrescher: If you look into IEEE754-2008 they say on page 44 (9.2.1.)

pown (x, 0) is 1 for any x (even a zero, quiet NaN, or infinity)

where pown(x,y) is x^y for y being an integral number. So this does look correct in Igor.

@joerg.kunze: This does look like a bug indeed. I would contact WM support.


[ last edited February 13, 2018 - 07:08 ]
Igor's picture
Posts: 810
Joined: 2007-06-29
Location: United States

Hello Joerg,

The value of 0^0 is typically argued based on a limit and required continuity. The same argument does not apply in the complex case where the limit depends on the path (and branch) so returning a NaN is, IMO prudent.

A.G.
WaveMetrics, Inc.


Back to top