[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-30 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Merged to py3k in r77146. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534 ___

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-21 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534 ___ ___

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-19 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534 ___ ___

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks for this; I'll take a look. Looks like we need some tests for this, too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's a set of testcases (patch against trunk) for float pow, based on Annex F of the C99 specification. -- keywords: +patch Added file: http://bugs.python.org/file15607/float_pow_testcases.patch

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-19 Thread Mark Dickinson
of -0.0. Here are corrected and slightly expanded tests; I've also fixed an incorrect doctest (0**nan should be nan, not 0) in Lib/test/ieee754.txt. -- Added file: http://bugs.python.org/file15610/float_pow_testcases2.patch ___ Python tracker rep

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Okay; I had to rework Marcos' patch a bit to get all the tests to pass. Here's the result. I propose making these changes only in 2.7 and 3.2, not in 2.6 or 3.1; it's just possible that there's code out there that relies on some of the

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-18 Thread Marcos Donolo
Marcos Donolo mdon...@vt.edu 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 rep...@bugs.python.orgwrote: Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti versions:

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-18 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Just upload it here clicking on 'Browse' next to the 'File' field and then click on 'Submit Changes'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-18 Thread Marcos Donolo
Changes by Marcos Donolo mdon...@vt.edu: Added file: http://bugs.python.org/file15597/floatobject.c ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534 ___

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-18 Thread Marcos Donolo
Marcos Donolo mdon...@vt.edu added the comment: I had to handle nans and infs in different places. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534 ___

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Marcos Donolo
New submission from Marcos Donolo mdon...@vt.edu: 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 stdin, line 1, in module ValueError

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +mark.dickinson priority: - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534 ___

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Mark Dickinson
Mark Dickinson 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

[issue7534] float('nan')**2 != nan. float('inf')**2 != inf. float('nan')**2 error 33 on windows

2009-12-17 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Closed 7536 as a duplicate of this issue. -- title: float('nan')**2 != nan. float('nan')**2 error 33 on windows - float('nan')**2 != nan. float('inf')**2 != inf. float('nan')**2 error 33 on windows

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Marcos Donolo
Marcos Donolo mdon...@vt.edu added the comment: I will give it a shot. On Thu, Dec 17, 2009 at 11:22 AM, Mark Dickinson rep...@bugs.python.orgwrote: Mark Dickinson dicki...@gmail.com added the comment: Yep. There's not much consistency in inf/nan handling across platforms, though

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Great! For math.pow, see the function math_pow in Modules/mathmodule.c; some sort of (careful!) cut-and-paste job from there to float_pow in Objects/floatobject.c might do the trick. -- ___

[issue7534] float('nan')**2 != nan. float('nan')**2 error 33 on windows

2009-12-17 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7534 ___

[issue7281] copysign() with NaN arguments on OpenSolaris

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Yes, I don't think Python 2.6 had a deliberate workaround. I suspect that it's just that one version of Python happened to use something like 0.0/0.0 to generate NaN, while another used some equivalent of strtod(nan, ...). I also remember

[issue7281] copysign() with NaN arguments on OpenSolaris

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Just to confirm the above: In 2.6, PyFloat_FromString in Objects/floatobject.c ends up using the system strtod to parse nan and -nan (except that if the system strtod fails to recognise nan for some reason then it returns the result of 0.0

[issue7281] copysign() with NaN arguments on OpenSolaris

2009-11-08 Thread Stefan Krah
an example: #include stdio.h #include math.h int main(void) { double x = NAN; printf(%f %f\n, x, copysign(1.0, x)); return 0; } This gives -NaN, -1.00 with suncc and NaN, 1.00 with gcc. Back to Python: sys.float_repr_style is 'legacy'. It looks like the C99

[issue7281] copysign() with NaN arguments on OpenSolaris

2009-11-07 Thread Stefan Krah
New submission from Stefan Krah stefan-use...@bytereef.org: Sorry to report so many obscure corner cases. With the combination Opensolaris/suncc/Python3.x copysign() gives reversed results when the second argument is a NaN. The bug is in the C99 copysign() function (OpenSolaris/suncc

[issue7281] copysign() with NaN arguments on OpenSolaris

2009-11-07 Thread Mark Dickinson
for HAVE_PY_SET_53BIT_PRECISION in Include/pyport.h for details. Having said that, I don't really see this difference with nans as an actual bug. Is it possible that float(nan) is simply giving a nan with its sign bit set here, and that float(-nan) is giving a nan with no sign bit set? That would

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-07 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: This whole thing is indeed a matter of taste, so I'd close the bug if no one else is interested. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7049

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-07 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I would like to look at this for a bit before it gets closed. -- assignee: mark.dickinson - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Raymond, can I recommend deprecating and eventually removing three- argument pow support from Decimal? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7049

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-07 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: Deprecate on the grounds that it is slow in decimal.py or the InvalidOperation issue? I think pure integer arithmetic with the decimal type always requires attention from the user, since in many functions one has to check for

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I was suggesting that it be deprecated on the grounds that: (1) It's not part of the Decimal standard. (2) It's not implemented for Python (binary) floats, so why implement it for decimal floats? (3) It's severely use-case challenged.

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-07 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: (1) is clearly true. I wonder about (2) and (3): The decimal data type is specified to be usable for integer arithmetic. With a high precision (and traps for Rounded/Inexact) I think it's reasonably convenient to use. --

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Shrug. That doesn't really bother me. x**y%z and pow(x, y, z) aren't going to match anyway, as soon as x**y has to be rounded. What would bother me more is the idea of having, with precision 4: pow(3, 22, 12347) - nan pow(3, 23, 12347

[issue7047] decimal.py: NaN payload conversion

2009-10-03 Thread Stefan Krah
New submission from Stefan Krah stefan-use...@bytereef.org: decimal.py sets InvalidOperation if the payload of a NaN is too large: c = getcontext() c.prec = 4 c.create_decimal(NaN12345) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.7/decimal.py

[issue7047] decimal.py: NaN payload conversion

2009-10-03 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7047 ___ ___

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-03 Thread Stefan Krah
New submission from Stefan Krah stefan-use...@bytereef.org: If precision 1 is aupported, the following results should not be NaN: Python 2.7a0 (trunk:74738, Sep 10 2009, 11:50:08) [GCC 4.3.2] on linux2 Type help, copyright, credits or license for more information. from decimal import

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-03 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7049 ___ ___

[issue7047] decimal.py: NaN payload conversion

2009-10-03 Thread Mark Dickinson
, diagnostic info too long in NaN) and again, the Context._raise_error method translates the ConversionSyntax exceptional condition to the corresponding InvalidOperation signal. Closing as a duplicate, just so we can keep everything one place. -- resolution: - duplicate status: open

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: This behaviour was deliberate: since the standard doesn't cover three- argument pow, I more-or-less made up my own rules here. :) In this case, I (somewhat arbitrarily) decided that to ensure that any possible pow(a, b, m) result could be

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Unless anyone else disagrees, I'm going to call this a 'won't fix': I'm happy with the current behaviour. I would like to relax the condition on the modulus from 'modulus 10**prec' to 'modulus = 10**prec', though, so I'm leaving the

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's a patch. -- keywords: +patch Added file: http://bugs.python.org/file15031/issue7049.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7049

[issue7049] decimal.py: NaN result in pow(x, y, z) with prec 1

2009-10-03 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: I don't think early abortion based on m and the current precision is a good idea. Then we have the situation that this works (prec=4): (Decimal(7) ** 2) % 10 But this does not: pow(Decimal(7), 2, 10) --

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-15 Thread Mark Dickinson
On Sep 14, 4:05 pm, Scott David Daniels scott.dani...@acm.org wrote: Steven D'Aprano wrote: On Sun, 13 Sep 2009 17:58:14 -0500, Robert Kern wrote: Exactly -- there are 2**53 distinct floats on most IEEE systems, the vast majority of which might as well be random. What's the point of caching

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-14 Thread Gabriel Genellina
En Sun, 13 Sep 2009 20:53:26 -0300, Steven D'Aprano st...@remove-this-cybersource.com.au escribió: There may be something to be said for caching common floats, like pi, small integers (0.0, 1.0, 2.0, ...), 0.5, 0.25 and similar, but I doubt the memory savings would be worth the extra

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-14 Thread Scott David Daniels
Steven D'Aprano wrote: On Sun, 13 Sep 2009 17:58:14 -0500, Robert Kern wrote: Exactly -- there are 2**53 distinct floats on most IEEE systems, the vast majority of which might as well be random. What's the point of caching numbers like 2.5209481723210079? Chances are it will never come up

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-14 Thread Terry Reedy
Gabriel Genellina wrote: En Sun, 13 Sep 2009 20:53:26 -0300, Steven D'Aprano st...@remove-this-cybersource.com.au escribió: There may be something to be said for caching common floats, like pi, small integers (0.0, 1.0, 2.0, ...), 0.5, 0.25 and similar, but I doubt the memory savings would be

numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
numpy.ndarray objects to disk which are of type float, but which may include NaN in some cells. When I unpickle these objects and then test for the presence of NaN, the test fails. Here's a minimal sample program, and its output: === program ## numpy

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Robert Kern
have a problem with numpy, or with my understanding of the Python pickle module, so I'm posting here. I am pickling numpy.ndarray objects to disk which are of type float, but which may include NaN in some cells. When I unpickle these objects and then test for the presence of NaN, the test fails

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
arrays are never guaranteed. Usually, they will always be different. You need to use numpy.isnan() to determine whether an object is a NaN. OK, so there's a dedicated function in numpy to handle this. Thanks! I tried x is NaN after noting the obvious, that any equality or inequality test

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Christian Heimes
John Ladasky wrote: OK, so there's a dedicated function in numpy to handle this. Thanks! I tried x is NaN after noting the obvious, that any equality or inequality test involving NaN will return False. In my leisure time, I would like to dig deeper into the issue of why object identities

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Robert Kern
John Ladasky wrote: In my leisure time, I would like to dig deeper into the issue of why object identities are not guaranteed for elements in numpy arrays... with elements of type float, at least, I thought this would be trivial. Why do you think that? We would have to keep a reference around

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Carl Banks
On Sep 13, 3:18 pm, John Ladasky john_lada...@sbcglobal.net wrote: In my leisure time, I would like to dig deeper into the issue of why object identities are not guaranteed for elements in numpy arrays... with elements of type float, at least, I thought this would be trivial. Unlike Python

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 17:58:14 -0500, Robert Kern wrote: John Ladasky wrote: In my leisure time, I would like to dig deeper into the issue of why object identities are not guaranteed for elements in numpy arrays... with elements of type float, at least, I thought this would be trivial.

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
On Sep 13, 4:17 pm, Carl Banks pavlovevide...@gmail.com wrote: On Sep 13, 3:18 pm, John Ladasky john_lada...@sbcglobal.net wrote: In my leisure time, I would like to dig deeper into the issue of why object identities are not guaranteed for elements in numpy arrays... with elements of type

[issue6794] decimal.py: incorrect results in NaN comparisons

2009-08-28 Thread Stefan Krah
).compare_total_mag(Decimal(-NaN99)) == Decimal('-1') Should be: Decimal('1') (checked against decNumber) -- components: Library (Lib) messages: 92032 nosy: skrah severity: normal status: open title: decimal.py: incorrect results in NaN comparisons

[issue6794] decimal.py: incorrect results in NaN comparisons

2009-08-28 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +marketdickinson priority: - normal type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6794 ___

[issue6794] decimal.py: incorrect results in NaN comparisons

2009-08-28 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - marketdickinson versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6794 ___

[issue6794] decimal.py: incorrect results in NaN comparisons

2009-08-28 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks for the report! I've applied a quick fix in the trunk in r74564; merged to other branches in r74565 (release26-maint), r74566 (py3k) and r74567 (release31-maint). -- resolution: - fixed stage: - committed/rejected status:

[issue4799] handling inf/nan in '%f'

2009-04-12 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I believe this is a duplicate of issue 4482. I'm closing this and will add everyone who is nosy on this to be nosy on 4482. -- resolution: - duplicate status: open - closed ___ Python tracker

[issue4799] handling inf/nan in '%f'

2009-04-09 Thread Christoph Zwerschke
Christoph Zwerschke c...@online.de added the comment: This is a related problem on Windows: '%g' % 1e400 - '1.#INF' '%.f' % 1e400 -- '1' -- nosy: +cito ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4799

[issue4799] handling inf/nan in '%f'

2009-03-30 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Assigning to Eric, at his request. -- assignee: marketdickinson - eric.smith nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4799

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-14 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks Martin and Mark Miller for the comments and testing. I'm going to close this as won't fix. This doesn't preclude ARM OABI becoming a supported platform at some point in the future, just not right now. -- resolution: - wont

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Miller
Mark Miller m...@mirell.org added the comment: This still occurs in the latest SVN checkout, and is preventing Python from building on ARMV4L and ARMV5L OABI, dying during the test_float.py compilation. The patch appears to solve this problem, however I have not run a full suite of tests to

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'll take a look at this, provided Tim doesn't mind me stealing his issue. (Please steal it back if so.) Mark, could you please post the output from test_float? -- assignee: tim_one - marketdickinson nosy: +marketdickinson

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Miller
Mark Miller m...@mirell.org added the comment: The following is where it fails un-patched: Compiling /usr/local/lib/python2.6/test/test_float.py ... Traceback (most recent call last): File /usr/local/lib/python2.6/compileall.py, line 156, in module exit_status = int(not main()) File

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks, Mark. A few comments: - The patch seems incomplete. There are other places in the source tree that care about endianness. I haven't done a thorough search, but the native endianness support in the struct module comes to mind.

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: native endianness support in the struct module comes to mind Sorry: ignore that. The patch already covers this, since the struct module just uses _PyFloat_{Unp,P}ack8. ___ Python tracker

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: We still need to fix the compile failure somehow, though... Mark, is there any way you can isolate the test(s) in test_float that are causing compile failure? I'm suspicious of test_inf_as_str and test_nan_as_str. Does test_float compile

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I think my -1 for adding the new format was premature: I was hoping to find a way to fix marshal for the 'unknown' format, but the cleanest solution does indeed appear to be to add the mixed-endian format. And apart from the

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I'm still not sure whether this can be a candidate 2.6 and 3.0. Martin, do you have any thoughts on this? I think this qualifies as a new port. In the past, we have avoided adding new ports in bugfix releases. As for adding it to

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Miller
Mark Miller m...@mirell.org added the comment: I am in a position to test as much as needed. I am attempting to get Gentoo's ARM/MIPS/Embedded distribution up to date on Python, and noticed this build break. (Typically most embedded architectures are several releases behind.) I'll try this new

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Miller
Mark Miller m...@mirell.org added the comment: The new patch works correctly, by the way, on ARMv4L and ARMv5L OABI boards. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1762561 ___

[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- versions: -Python 2.5, Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1762561 ___ ___

[issue4799] handling inf/nan in '%f'

2009-02-11 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - marketdickinson nosy: +marketdickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4799 ___

[issue1732212] repr of 'nan' floats not parseable

2009-02-10 Thread Daniel Diniz
Daniel Diniz aja...@gmail.com added the comment: OP posted a message in python-dev, with no replies: http://mail.python.org/pipermail/python-dev/2007-June/073625.html -- nosy: +ajaksu2, marketdickinson versions: +Python 2.7, Python 3.1 -Python 2.6

[issue1732212] repr of 'nan' floats not parseable

2009-02-10 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I don't see a huge need for this. In 2.6, 3.0 and higher, float(repr(x)) recovers x reliably across platforms (modulo the occasional system strtod bug), even when x is an infinity or nan. It's true that using float() doesn't help if you

[issue1732212] repr of 'nan' floats not parseable

2009-02-10 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - marketdickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1732212 ___ ___

[issue1732212] repr of 'nan' floats not parseable

2009-02-10 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Recommend closing this. We like to have eval(repr(obj))==obj where possible but it is not a strict requirement. Am opposed to the two proposed solutions (float attributes or new literals). Mark's solution of defining nan

[issue1732212] repr of 'nan' floats not parseable

2009-02-10 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1732212 ___

[issue2121] complex constructor doesn't accept string with nan and inf

2009-01-20 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Closing this one as won't fix. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2121 ___

[issue2121] complex constructor doesn't accept string with nan and inf

2009-01-06 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [Mark] inputs with a special real or imaginary component. On balance, I'd support making complex('nan + nan*j') do the right thing. Having thought about this a bit more, I take this back. Some reasons are given below. [David

[issue2121] complex constructor doesn't accept string with nan and inf

2009-01-06 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Christian, any comments? Is it okay to close this as a 'won't fix'? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2121 ___

[issue2121] complex constructor doesn't accept string with nan and inf

2009-01-06 Thread Cournapeau David
Cournapeau David da...@ar.media.kyoto-u.ac.jp added the comment: @ Mark Concerning float('inf') * 1j: you're right, my rambling did not make any sense, sorry. I agree that adding complexity may be a good reason to warrant an arbitrary feature; actually, I did not manage to handle nan/inf

[issue2121] complex constructor doesn't accept string with nan and inf

2009-01-06 Thread Raymond Hettinger
be pursued. I see no utility in pairs like (NaN, 3.0) or (-2.0, Inf). The whole request is use case challenged. AFAICT, the current implementation suffice for real cases and there is no compelling need to rearrange and redesign this code. ___ Python tracker

[issue2121] complex constructor doesn't accept string with nan and inf

2009-01-02 Thread Mark Dickinson
these infinities. But the cmath module *does* make an effort to return the 'correct' (according to C99 Annex G) values for inputs with a special real or imaginary component. On balance, I'd support making complex('nan + nan*j') do the right thing. (Though I can't help feeling that the repr

[issue2121] complex constructor doesn't accept string with nan and inf

2009-01-02 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: cdavid, in your application, how hard is it to work around the problem by simply printing and parsing pairs of floats rather than complex numbers? E.g., get real part and imaginary part from string z = complex(float(real_part),

[issue2121] complex constructor doesn't accept string with nan and inf

2009-01-02 Thread Cournapeau David
Cournapeau David da...@ar.media.kyoto-u.ac.jp added the comment: It is not really for an application, but for numpy. Of course, one can always get around the problem - but since this is really a limitation which can be easily fixed, why not fixing the problem :) ?

[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David
a very real problem: incidently, I got interested in this patch while working on numpy, and it is certainly useful to be able to parse nan and inf (for example when we create arrays from strings). Nan may be seen as non useful for so called real usage of python, but for scientific people

[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Raymond Hettinger
real-world use cases arise. ... for scientific people, it is a crucial to have proper support of nan (which may mean missing data depending on the context) and inf. Mark, does Inf have a standard interpretation for complex numbers? Do all infinities meet or do they radiate, each with their own

[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David
and test. Yes, it is difficult to handle nan and inf, there are a lot of corner cases. But I fail to see how this applies here: my patch is essentially a rewrote of the parsing, and the code to handle nan/inf is only 7 lines. This is independent of the handling of how nan/inf is handled by math

[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David
Cournapeau David da...@ar.media.kyoto-u.ac.jp added the comment: Ok, I found out how to make tests, and I found some problems while using this on numpy. A third version of the patch, with unit tests: all tests in test_complex.py pass. Added file: http://bugs.python.org/file12504/nan_parse.patch

[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David
Changes by Cournapeau David da...@ar.media.kyoto-u.ac.jp: Removed file: http://bugs.python.org/file12503/nan_parse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2121 ___

[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David
Changes by Cournapeau David da...@ar.media.kyoto-u.ac.jp: Removed file: http://bugs.python.org/file12502/nan_parse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2121 ___

[issue4799] handling inf/nan in '%f'

2008-12-31 Thread Cournapeau David
nosy: cdavid severity: normal status: open title: handling inf/nan in '%f' versions: Python 2.6 Added file: http://bugs.python.org/file12518/nan.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4799

[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-30 Thread Cournapeau David
Cournapeau David da...@ar.media.kyoto-u.ac.jp added the comment: I started a patch against the trunk to handle nan/inf/infinite (I have not yet tackled the problem of negative zero). The patch is a bit big, because I found the function quite difficult to follow, so I refactored it a bit first

[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-30 Thread Cournapeau David
Cournapeau David da...@ar.media.kyoto-u.ac.jp added the comment: Of course, I notice two bugs just after sending the patch... New patch to fix those two issues (no check for closing bracket if opening ones are there and a bug when only imaginary part is given). Added file:

[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-11 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: Merged to 2.6 and 3.0 maintenance branches (r67700, r67701). -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4084

[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-10 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Unless Facundo or some of the other decimal contributors reviews and applies this patch really quickly, it is out of scope for 2.5.3. -- nosy: +loewis ___ Python tracker [EMAIL PROTECTED]

[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-10 Thread Facundo Batista
Facundo Batista [EMAIL PROTECTED] added the comment: Commited in trunk and Py3, thanks Mark! Please, could you commit it in 2.5? The only change I've made in the patch is adding the issue number to Misc/NEWS, the rest is ok. After that, just close this. Thanks again! -- versions:

[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-10 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Mark, if you want to backport this, please go ahead. If want me to, assign to me. -- assignee: facundobatista - marketdickinson priority: normal - release blocker ___ Python tracker [EMAIL

[issue4084] Decimal.max(NaN, x) gives incorrect results when x is finite and long

2008-12-06 Thread Mark Dickinson
Changes by Mark Dickinson [EMAIL PROTECTED]: -- versions: +Python 3.1 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4084 ___ ___ Python-bugs-list

[issue4296] Python assumes identity implies equivalence; contradicts NaN

2008-11-12 Thread Mark Dickinson
Changes by Mark Dickinson [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file11989/issue4296.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4296 ___

[issue4296] Python assumes identity implies equivalence; contradicts NaN

2008-11-12 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: Before committing, please add one other test that verifies the relationship between in in membership tests and in in a for-loop: Added. (To test_contains, since this seems like a more appropriate place than test_float.) Added file:

<    5   6   7   8   9   10   11   12   >