Tim Peters <tim.one@comcast.net> writes: > 2/3r works for both for me. 0.666...7 doesn't work for me at all as > a stringification of a rational (if I want to approximate, I'll ask > for an approximation). I agree. I initially thought about returning a decimal with str(), but for that reason chose not to. It might be nice to have a method that returned the best floating point decimal approximation to within n decimal digits or shorter, but I don't want a builtin to make an arbitrary decision on where to cut off precision. I do like the idea of str() returning the form 5+3/2r, though. -- Christopher A. Craig <list-python@ccraig.org> Python is an excellent language for learning object orientation. (It also happens to be my favorite OO scripting language.) Sriram Srinivasan -- "Advanced Perl Programming"
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4