Prothon vs. Python integers

Greg Ewing greg at cosc.canterbury.ac.nz
Tue May 25 22:59:43 EDT 2004


Mark Hahn wrote:
>
> Surely
> once you get to 3.7e19 you are in floating point territory.

Incorrect. You're only ever in floating point territory
if you can tolerate inexact results. Some applications
can't.

Even if you don't support arbitrary-size integers, you
should *not* automatically overflow from ints to floats.
You should raise an exception instead. That way, people
won't be bitten by unexpected loss of precision.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list