Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Try it in JS with console.log(4.225 * 100);, you'll see the same unexpected result. Depending on your needs, it's actually fine to just be off by some amount. If it does really matter, then use an arbitrary precision library like https://github.com/shopspring/decimal to get the results you need.
Start by understanding that the "4.225", "4.224", ... in your code are not "floats" in the sense if IEEE float64: They are decimal (!) and might not be representable in float64. See e.g. https://0.30000000000000004.com/
NOTE:
The number of mentions on this list indicates mentions on common posts plus user suggested alternatives.
Hence, a higher number means a more popular project.