Document. The write (3 * 4.8)
</script>
The results as follows: 14.399999999999999
Why is this? Don't understand, ask for advice
CodePudding user response:
JavaScript, the precision of the floating-point arithmetic problemshttps://www.html.cn/archives/7340
CodePudding user response:
Computer is not necessarily accurate store floating-pointThe storage format of floating-point Numbers refer to the following link
https://www.jianshu.com/p/8ee02e9bb57d
CodePudding user response:
Is my CPU is brokenCodePudding user response:
Precision loss...Py:
Js:
Take 10 again in addition to the first converted to an integer to avoid decimal arithmetic operation