Stuart Brorson wrote:
> I have been poking at the limits of NumPy's handling of powers of
> zero.   I find some results which are disturbing, at least to me.
> Here they are:

[SNIPP]

Please checkout Mark Dickinson's and my trunk-math branch of Python 2.6.
We have put lots of effort into fixing edge cases of floats, math and
cmath functions. The return values are either based on the latest
revision of IEEE 754 or the last public draft of the C99 standard (1124,
Annex F and G).

For pow the C99 says:

>>> math.pow(0, 0)
1.0
>>> math.pow(0, 1)
0.0
[30859 refs]
>>> math.pow(0, float("inf"))
0.0
>>> math.pow(0, float("nan"))
nan
>>> math.pow(0, -1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: math domain error

Christian

_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to