Python错误集合

python入门错误集合

ValueError: math domain error

此处使用求根公式,发生 ValueError: math domain error 错误
Python错误集合
错误名称:数学域错误
原因:某些操作不符合数学定义,如对负数取对数,对负数开平方。

零为被除数

root1=2* C/0,故报错
Python错误集合

浮点数乘法精确度

原因是实数的无限精度和内存的有限精度
使用round(a*b)