[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows
New submission from Marcos Donolo : I am not getting the expected result for the ** operator on windows, python 2.6 I do... a=float('nan') b=a*a then b is nan which is right but if I do b = a**2 I get. Traceback (most recent call last): File "", line 1, in ValueError: (33, 'Domain error') If I do a**2 on ubuntu, python 2.6 I get nan again. -- components: Interpreter Core messages: 96523 nosy: mdon...@vt.edu, tim_one severity: normal status: open title: float('nan')**2 != nan. float('nan')**2 error 33 on windows type: behavior versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue7534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7536] float('inf')**2 != inf
New submission from Marcos Donolo : The ** operator produces an error when it gets inf as an argument. if I try. >>>a=float('inf') >>>a*a inf -but if I try >>>a**2 Traceback (most recent call last): File "", line 1, in OverflowError: (34, 'Result too large') I should get inf too. -- components: Interpreter Core messages: 96527 nosy: mdonolo, tim_one severity: normal status: open title: float('inf')**2 != inf type: behavior versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue7536> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows
Marcos Donolo added the comment: I will give it a shot. On Thu, Dec 17, 2009 at 11:22 AM, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > Yep. There's not much consistency in inf/nan handling across platforms, > though the situation is slowly getting better. math.pow makes an effort > to handle these special cases correctly (for some value of correctly), and > it would probably make some sense to have the builtin pow behave the same > way. > > Would you be interested in contributing a fix? > > -- > stage: -> needs patch > > ___ > Python tracker > <http://bugs.python.org/issue7534> > ___ > -- title: float('nan')**2 != nan. float('inf')**2 != inf. float('nan')**2 error 33 on windows -> float('nan')**2 != nan. float('nan')**2 error 33 on windows Added file: http://bugs.python.org/file15584/unnamed ___ Python tracker <http://bugs.python.org/issue7534> ___I will give it a shot.On Thu, Dec 17, 2009 at 11:22 AM, Mark Dickinson <mailto:rep...@bugs.python.org";>rep...@bugs.python.org> wrote: Mark Dickinson <mailto:dicki...@gmail.com";>dicki...@gmail.com> added the comment: Yep. Â There's not much consistency in inf/nan handling across platforms, though the situation is slowly getting better. Â math.pow makes an effort to handle these special cases correctly (for some value of correctly), and it would probably make some sense to have the builtin pow behave the same way. Would you be interested in contributing a fix? -- stage: Â -> needs patch ___ Python tracker <mailto:rep...@bugs.python.org";>rep...@bugs.python.org> <http://bugs.python.org/issue7534"; target="_blank">http://bugs.python.org/issue7534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows
Marcos Donolo added the comment: Ok, I have patch ready. how do we go about putting it in? thanks. marcos On Thu, Dec 17, 2009 at 11:52 AM, Ezio Melotti wrote: > > Changes by Ezio Melotti : > > > -- > nosy: +ezio.melotti > versions: +Python 3.1 > > ___ > Python tracker > <http://bugs.python.org/issue7534> > ___ > -- Added file: http://bugs.python.org/file15595/unnamed ___ Python tracker <http://bugs.python.org/issue7534> ___Ok, I have patch ready. how do we go about putting it in?thanks.marcosOn Thu, Dec 17, 2009 at 11:52 AM, Ezio Melotti <mailto:rep...@bugs.python.org";>rep...@bugs.python.org> wrote: Changes by Ezio Melotti <mailto:ezio.melo...@gmail.com";>ezio.melo...@gmail.com>: -- nosy: +ezio.melotti versions: +Python 3.1 ___ Python tracker <mailto:rep...@bugs.python.org";>rep...@bugs.python.org> <http://bugs.python.org/issue7534"; target="_blank">http://bugs.python.org/issue7534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows
Changes by Marcos Donolo : Added file: http://bugs.python.org/file15597/floatobject.c ___ Python tracker <http://bugs.python.org/issue7534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows
Marcos Donolo added the comment: I had to handle nans and infs in different places. -- ___ Python tracker <http://bugs.python.org/issue7534> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com