Tzury Bar Yochay wrote:
Because math.pow returns a float; 100 ** 155 won't fit in a float.

Sure that is the reason.
May I rephrase, my question:
Why not returning another type as long as we can calculate it?
After all, math module is likely to be used on large numbers as well.

Because it's very complicated to get it right. The math module is a thin wrapper around the platform math library. It took Mark and me very long to get cmath and math right for floats (C doubles). Arbitrary precision and arbitrary length numbers are a different story. You have to use 3rd party tools for those. The standard library aims to solve common problems, not special problems.

Christian

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to