[Edu-sig] Exponentiation should float

Tim Peters tim_one@email.msn.com
Wed, 16 Feb 2000 00:55:21 -0500


On almost all platforms, Python floats are IEEE-754 doubles, which have a
maximum (positive finite) value a little less than 2L**1024 (a little more
than 300 decimal digits, but only about 15 of which are accurate:  at most
the leading 53 bits are accurate).

Python longs have no such restrictions on either maximum magnitude or
precision; they can-- if needed --grow to fill your machine's whole memory.

So integer exponentiation should not float (can easily overflow to floating
infinity, and even more easily lose information).

The subtleties of floating-point are substantial <0.1 wink, which is *not*
exactly a tenth of a wink in IEEE-standard floating arithmetic>.

"floating-point-for-everybody"-is-a-non-starter<wink>-ly y'rs  - tim