Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Python floating point numbers are limited in their mantissa, this is why float(2.23799235765712699e47675) is inf. Since python doesn't have arbitrary precision floating point numbers, you can't use python string formatting to achieve what you want. You can, however, write your own printing routine for arbitrary precision (MPFR) reals.

Python floating point numbers are limited in their mantissa, exponent, this is why float(2.23799235765712699e47675) is inf. Since python doesn't have arbitrary precision floating point numbers, you can't use python string formatting to achieve what you want. You can, however, write your own printing routine for arbitrary precision (MPFR) reals.