On Oct 23, 8:21 pm, Tzury Bar Yochay <[EMAIL PROTECTED]> wrote: > What is the reason math.pow yields OverflowError while python itself > can > calculate these large numbers. e.g: > > >>> import math > >>> math.pow(100, 154) > 1e+308 > >>> math.pow(100, 155) > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > OverflowError: math range error>>> eval(('100*'* 155)[:-1]) > > 10000000000000000000000000000000000000000000000000000000000 > 00000000000000000000000000000000000000000000000000000000000 > 00000000000000000000000000000000000000000000000000000000000 > 00000000000000000000000000000000000000000000000000000000000 > 00000000000000000000000000000000000000000000000000000000000 > 0000000000000000L
Because math.pow returns a float; 100 ** 155 won't fit in a float. -- http://mail.python.org/mailman/listinfo/python-list