[Python-ideas] numerical type combining integer and float/decimal properties [Was: Re: Python Numbers as Human Concept Decimal System]
Wolfgang Maier
wolfgang.maier at biologie.uni-freiburg.de
Wed Mar 12 16:48:39 CET 2014
Guido van Rossum <guido at ...> writes:
>
> This representation makes more sense, it is fixed point. But you can just
use a single integer and keep track of where the point should be.
Right, the main reason why I haven't tried that is that I started out with
an int for representing the integral part and a Decimal for the rest, so
from the beginning I always had two separate objects in the code.
On the other hand, I assume that a single int might also slow down the
trimming of the fractional part, which is necessary to keep its precision
fixed ?
More information about the Python-ideas
mailing list