[Python-ideas] Python Numbers as Human Concept Decimal System

random832 at fastmail.us random832 at fastmail.us
Fri Mar 7 21:48:04 CET 2014


On Thu, Mar 6, 2014, at 7:46, Stephen J. Turnbull wrote:
> Steven D'Aprano writes:
> 
>  > The problem is that fractions can be unbounded in memory,
> 
> Seminumerical Algorithms has a few problems on "floating slash", ie a
> representation of numbers where the total memory allocated to a
> fraction is fixed, but the amounts allocated to numerator and
> denominator are variable.  I don't know if it has ever been tried in
> practice, though.  And of course any reasonable fixed size would have
> very limited ability to express very large or very small magnitudes.

Or, for that matter, you could limit both the numerator and the
denominator to some maximum value - when an intermediate result exceeds
it (won't be more than the square of the maximum for most operations),
you find the closest representable value.


More information about the Python-ideas mailing list