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
Identical floats print inconsistently #43779
Comments
Hi, and thank you. Many bugs relating to this have been submitted by The following session prints a single variable three ----------- [me@localhost current]$ python
Python 2.4.1 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> a = round(1./7, 3)
>>> print a
0.143
>>> print (a,)
(0.14299999999999999,)
>>> print (a,)[0]
0.143
>>> I'm fully informed about IEEE floating point Once the interpreter recurses to a depth where it's Marc |
Logged In: YES Sorry, but this is another "not a bug". "print tuple" invokes tuple.__repr__() (because there is no |
Logged In: YES gbrandl is correct that the differences here are entirely It may be considered unfortunate that tuple.__repr__ is the
would display the incomprehensibly confused:
IOW, it's actually the difference in what string types do Alas, that's not always what people using strings want |
Logged In: YES Hi Tim and Georg, Thanks for your kind replies. I've followed up with feature Enjoy the weekend! I'll be writing a ray tracer.... Marc |
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: