From: "Greg Ewing" <greg@cosc.canterbury.ac.nz> > > The HP32SII calculator implements a useful rational model using > > flags and a maximum denominator register. If the first flag is clear, > > fractions are have denominators upto the maximum value. If only > > the first flag is set, fractions always use the maximum denominator > > as the denominator and are then reduced (i.e. if the max is 8, then > > .5 is represented as 1/2 and .1 is represented as 1/8). > > I can see that being useful when you're doing calculations > with, e.g. measurements in 64ths of an inch and you don't > care if anything smaller than that isn't quite exact. > > But I get the impression that the folks who want rationals > in Python want them precisely because they're *always* > exact. If you couldn't rely on them to always be exact, > it would defeat the purpose. For that, I propose maxdenom=None to let the rationals grow without bound. Raymond Hettinger
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