gpt4 book ai didi

javascript - javascript中的小数减法问题

转载 作者:搜寻专家 更新时间:2023-11-01 04:46:07 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Is JavaScript's Math broken?

当我减去 6.4-1.6 时,我在 JS 中得到的答案是 4.800000000000001,但我需要 4.8 而不使用 toFixed()、toPrecision() 和 Math.round()。任何的想法???

谢谢,

Crystal

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