3 ms·
There's some discussion here: https://docs.python.org/3.1/tutorial/floatingpoint.html https://docs.python.org/3.1/tutorial/floatingpoint.html. Basically: eval(r
by evanpw 11y ago
There's some discussion here: https://docs.python.org/3.1/tutorial/floatingpoint.html https://docs.python.org/3.1/tutorial/floatingpoint.html. Basically: eval(repr(x)) == x is guaranteed, and some attempt is made to give the shortest such string representation for Python 3.1+ (and 2.7?), but it's not guaranteed on all platforms.