Есть код:
# -*- coding:cp1251 -*- import math eps = 0.001 x = 5.0 rez = x znam = 2 shag = 2 while True : n = znam el = 1 - x**n / math.factorial(znam) rezNew = rez + el if abs( rezNew - rez ) < eps : rez = rezNew break rez = rezNew znam += shag print math.cos(x), rez
Выдает ошибку:
Traceback (most recent call last):
File “Dpython/zad4/z4.2.4.py”, line 13, in <module>
el = 1 - x**n / math.factorial(znam)
OverflowError: long int too large to convert to float
В чем проблема?