[Python-Dev] Revamping Python's Numeric Model

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 7 Nov 2000 02:13:04 +0100


> I seriously wonder whether that was *the* problem with ABC: not only
> was 1.0 treated as an exact rational in ABC, so was 6.02e23 and
> 3.14159e-314 etc.  At least for me, this caused rationals to get
> used in many places I *intended* to use floats.  I assume many
> others got burned by this too, as I'd say it's impossible for users
> coming from other languages not to see 6.02e23 etc as float
> literals.

There seems to be a long tradition in Python of annotating literals to
get them interpreted in a different way; I think it would be
reasonable to tell apart floating point literals and rational literals
(with a power-of-ten denominator).

Specifically, the "scientific notation" could be used: 1.1 would be
exactly the same as 11/10, 1.1e0 would be binary floating point, and
only approximately equal to 11/10.

Regards,
Martin