gpt4 book ai didi

java - BigDecimal 的未缩放值是多少?

转载 作者:行者123 更新时间:2023-11-29 09:47:29 25 4
gpt4 key购买 nike

我正在阅读 BigDecimal 的文档,但我不明白 unscaled 的含义。谁能举例说明一下?谢谢。

这是上下文

Immutable, arbitrary-precision signed decimal numbers. A BigDecimal consists of an arbitrary precision integer unscaled value and a 32-bit integer scale. If zero or positive, the scale is the number of digits to the right of the decimal point. If negative, the unscaled value of the number is multiplied by ten to the power of the negation of the scale.

最佳答案

A BigDecimal consists of an arbitrary precision integer unscaled value and a 32-bit integer scale

unscaled integer value of arbitrary precision: 87866787879879879768767554645434
scale: 3

If zero or positive, the scale is the number of digits to the right of the decimal point.

actual decimal value: 87866787879879879768767554645.434

If negative, the unscaled value of the number is multiplied by ten to the power of the negation of the scale.

unscaled integer value: 87866787879879879768767554645434
scale: -3
actual decimal value: 87866787879879879768767554645434000

关于java - BigDecimal 的未缩放值是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30410612/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com