> I maintain that when comparing a long with a float > where the exponent is larger than the precision, that the > float should be treated as if it were EXACTLY EQUAL TO > <coefficient>*2^<exponent>, instead of trying to treat it as > some sort of a range. Similarly, if we implemented a Rational > type, I would suggest that instances of float (or of Facundo's > Decimal) where <exponent> is LESS than the digits of > <coefficient> should be treated as if they were EXACTLY EQUAL > TO the corresponding fraction-over-a-power-of-two. Right. I'm an amateur in this field too, but I've now been convinced many times over this is what comparisons *should* do, rather than converting the long (or int) to float and doing the comparison as float (what they currenttly do). Anyone feel like implementing this for 2.4? (Andrew Koenig posted an algorithm here a few weeks or so ago.) (For other operations, I still want to see e.g. long+float to return a float rather than a long -- you *have* to do it this way for obvious reasons when the values are relatively small, e.g. consider 1 + 0.5.) --Guido van Rossum (home page: http://www.python.org/~guido/)
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