今天线上报了一个这样的错误 经过排查发现是因为对Bigdecimal类型做除法divide()运算时
除数为0导致的 加了一个非0的判断就好了。
当我们的被除数为整型(short,int,long)时 除数不能为0
除数如果为double 即 0.0时 不会报错
ArithmeticException:错误的定义是 :
Thrown when an exceptional arithmetic condition has occurred.
For example, an integer "divide by zero" throws an instance of this class.
当出现异常的运算条件时,抛出此异常。
例如,一个整数“除以零”时,抛出此类的一个实例。