错误代码门户
PythonPython错误代码

OverflowError

OverflowError

代码 OverflowError · Python 报告的问题。

当算术运算的结果太大而无法表示时引发。对于整数来说,这种情况不会发生(这宁愿引发 MemoryError 而不是放弃)。但是,由于历史原因,有时会因超出所需范围的整数而引发 OverflowError。由于 C 语言中浮点异常处理缺乏标准化,因此大多数浮点运算都不会被检查。

Google Translate · 此内容为自动翻译。技术术语及适用条件请以英文原文为准。

Raised when the result of an arithmetic operation is too large to be represented. This cannot occur for integers (which would rather raise MemoryError than give up). However, for historical reasons, OverflowError is sometimes raised for integers that are outside a required range. Because of the lack of standardization of floating-point exception handling in C, most floating-point operations are not checked.

故障排除与诊断链接

请先确认文档中的产品、版本及发生环境与当前情况一致。