In direct floating-point arithmetic, there will be a calculation error, which is not a language problem, but a computer problem. So try to avoid floating point operations, and inevitably use mathematical functions. When money is involved, it is best to use BCMath.
Math function address: Math function
BCMath Address: Arbitrary Precision Math