[Python-ideas] numerical type combining integer and float/decimal properties [Was: Re: Python Numbers as Human Concept Decimal System]

Guido van Rossum guido at python.org
Wed Mar 12 17:15:15 CET 2014


On Wed, Mar 12, 2014 at 8:49 AM, <random832 at fastmail.us> wrote:

> On Wed, Mar 12, 2014, at 11:37, Guido van Rossum wrote:
> > 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.
>
> If you're keeping track of it other than implicitly, isn't that floating
> point? Just of a NNNNNNN*10^-X variety instead of 1.NNNNNN*2^X.
>

No, his rules for how many digits to keep (everything to the left, only 28
to the right) make it fixed-point. Keeping track of the number explicitly
just makes it simpler to create variants where instead of 28 you use
another number of digits.

But the use cases for this kind of representation are pretty limited.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140312/7702906a/attachment.html>


More information about the Python-ideas mailing list