Answers for "A Note about Floats"

0

A Note about Floats

console.log(0.1 + 0.2);  // 0.30000000000000004
console.log((0.1 * 10 + 0.2 * 10) / 10);  // 0.3

console.log(1.03 + 1.04);  // 2.0700000000000003
console.log((1.03 * 100 + 1.04 * 100) / 100);  // 2.07
Posted by: Guest on April-15-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language