New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
float issue for NaN type in .pyc file #41289
Comments
There is a difference in output between .pyc and .py The content of my sample program While execution: command: python test.pyc |
Logged In: YES Python guarantees nothing about behavior in the This should be closed with a reference to PEP-42 (I don't |
Logged In: YES My test cases passes for the first time but fails second |
Logged In: YES I know first hand how much of a pain this issue can be. However it's not clear what can be done about it. My vote |
Logged In: YES dileep_nirala: Yes, I understood the problem. That |
Logged In: YES BTW, while nothing is guaranteed here, your best shot pinf = 1e300 * 1e300
minf = -pinf
nan = pinf - pinf That will work the same way from .py or .pyc. Whether |
Logged In: YES If this is all accidental behavior, maybe something Imagining something like:
>>> 2e308
<stdin>:1: OverflowWarning: behavior of special
floating-point value undefined.
inf
Or else:
>>> marshal.dumps(2e308)
<stdin>:1: RuntimeWarning: marshal of special floating-point
value undefined.
's\x05\x00\x00\x002e308' |
Logged In: YES And, er, how do you do that? AFAIK, isnan is in SUS and C99 and recommended by IEEE-754 but isn't OTOH, pyport.h seems to have a Py_IS_NAN macro already. Maybe that |
Logged In: YES This issue should finally be dead in Python CVS HEAD. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: