BigDecimal是标准的类,在编译器中不需要特殊支持,它可以表示任意精度的小数,并对它们进行计算。
BigDecimal is a standard class, with no special support in the compiler, to represent arbitrary-precision decimal Numbers and perform arithmetic on them.
在内部,可以用任意精度任何范围的值和一个换算因子来表示BigDecimal,换算因子表示左移小数点多少位,从而得到所期望范围内的值。
Internally, BigDecimal is represented as an arbitrary-precision unscaled value and a scale factor, which represents how many places to move the decimal point left to obtain the scaled value.
应用推荐