相关疑难解决方法(0)

在python中得到Decimal的Ceil()?

有没有办法在python中获得高精度Decimal的ceil?

>>> import decimal;
>>> decimal.Decimal(800000000000000000001)/100000000000000000000
Decimal('8.00000000000000000001')
>>> math.ceil(decimal.Decimal(800000000000000000001)/100000000000000000000)
8.0
Run Code Online (Sandbox Code Playgroud)

math对值进行舍入并返回非精确值

python decimal rounding ceil

9
推荐指数
2
解决办法
8887
查看次数

标签 统计

ceil ×1

decimal ×1

python ×1

rounding ×1