[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
Mon Mar 10 19:03:12 CET 2014


Guido van Rossum <guido at ...> writes:
 
> 
> 
> I think what you're proposing here is variant of fixed-point numbers. The
representation you seem to be looking for is an arbitrary-precision integer
plus an exponent. A question for you: how would you treat results like 1/3?
> 

No, I don't think this is what I'm proposing. I said digits left of the
decimal point should behave like a Python integer, i.e., have arbitrary
precision, but to the right of it things should look like a float or Decimal
with fixed precision. So 1/3 would just look like float(1/3) for example.

Best,
Wolfgang



More information about the Python-ideas mailing list