Example 1 — Basic Use
Some numbers fit exactly in 32 bits. Others are rounded.
console.log(Math.fround(5)); // 5
console.log(Math.fround(5.5)); // 5.5
console.log(Math.fround(5.05)); // 5.050000190734863
console.log(Math.fround(1.337)); // 1.3370000123977661 How It Works
- Exact values.
5and5.5are stored exactly. - Rounded values.
5.05is stored as5.050000190734863. - Extra digits. The extra digits show the 32-bit rounding.

