21.01.20 10:37, Eric V. Smith пише:
For what it's worth, float's repr internally uses a format of '.17g'. So, format(value, '.17g') will be equal to repr(f), where f is any float.
It was in Python 2, but since Python 3.1 it returns the shortest unambiguous representation, which may be shorter than 17 digits.
https://docs.python.org/3/whatsnew/3.1.html#other-language-changes https://bugs.python.org/issue1580 _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/22IWLRREAHKAR3LKSFUWFUT4PRPZ3JG2/ Code of Conduct: http://python.org/psf/codeofconduct/
