Closed
Description
Currently, Magento uses floats to represent prices internally. This is a very bad design decision, as binary floating point numbers cannot accurately represent decimal values, which means you have to manually correct the resulting loss of precision after complex calculations. This process is error-prone. Fortunately, the BCMath extension, which is enabled by default, provides arbitrary-precision decimal math.
I'd suggest that Magento moves from floating point calculations to BCMath calculations in the long term. Since PHP converts numeric strings to floats automatically when necessary, the code can be slowly migrated on a module-per-module basis.
Metadata
Metadata
Assignees
Labels
No labels