|
Posted by Ian B on 12/05/05 14:25
round() converts the result of whatever is between the parentheses to a
float and rounds that up to whatever number of decimals you want, so
you start getting problems around the 15th decimal.
The bcmath functions work on strings to whatever degree of accuracy you
ask for and will never produce errors.
So basically if you round up to fewer than, say ten decimals, ordinary
maths functions are fine, but more than that, use bcmath.
Of course, with ints you just get ints back.
Ian
Navigation:
[Reply to this message]
|