3 ms·
Another option is to use printf, as like other languages it can take a precision argument. printf('%.17f', 0.1 + 0.2); // 0.30000000000000004
by McGlockenshire 11y ago
Another option is to use printf, as like other languages it can take a precision argument.
printf('%.17f', 0.1 + 0.2); // 0.30000000000000004