Just follow the built-in float('nan'): In [594]: float('nan')**0 Out[594]: 1.0
In [595]: 1**float('nan') Out[595]: 1.0 Aaron Meurer On Tue, Feb 21, 2012 at 7:58 PM, Chris Smith <smi...@gmail.com> wrote: > Quoting wikipedia's article on NaN: > > The 2008 version of the IEEE 754 standard says > that pow(1,qNaN) and pow(qNaN,0) should both return 1 since they return 1 > whatever else is used instead of quiet NaN. > > To satisfy those wishing a more strict interpretation of how the power > function should act, the 2008 standard defines two additional power > functions; pown(x, n) where the exponent must be an integer, and powr(x, > y) which returns a NaN whenever a parameter is a NaN or the exponentiation > would give an indeterminate form. > > > qNaN is a "quiet NaN"; the other type of NaN is a "signaling NaN": > "Signaling NaNs, or sNaNs, are special forms of a NaN that when consumed by > most operations should raise an invalid exception and then, if appropriate, > be "quieted" into a qNaN that may then propagate." SymPy only has one type > of NaN. > > > We have a half-implemented version currently: S(1)**S.NaN == S.NaN but > S(0)**S.NaN == S.One. So which way should we go? > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.