[BNM] php rounding bizzarreness
'Alex' Bridge
alx at dashalx.co.uk
Thu Mar 9 13:12:41 GMT 2006
Andy Galletly wrote:
> I'm willing to admit my maths may be dodgy at times, but,
> how come php does this?
>
[snip]
> Surely the vat should round up, the same as the total rounds up??
>
Looks like you're using an older version of PHP - up to version 4.2.x it
used Banker's rounding , which on exact halves always rounds to the even
number.
http://en.wikipedia.org/wiki/Significance_arithmetic ("The round-to-even
rounding rule") for details of why one might want to round that way.
Cheers,
-alx
More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service