[thelist] ASP 2.0 Functions

Paul Cowan evolt at funkwit.com
Sun Jul 21 21:17:00 CDT 2002


Chris Blessing wrote (many moons ago, but it's Monday morning here so I
just got it):
> Also note that round() can be rather unreliable sometimes, not always
> rounding a particular number up as you would expect.  I forget why this is
> but there's some valid reason for it.

Had to chip in here.

I'm fairly sure that round(), in VBScript, rounds to the nearest
even integer (e.g. answer mod 2 = 0) when the answer ends exactly in .5.

So:

1.5 -> 2
2.5 -> 2
3.5 -> 4
4.5 -> 4

etc.

I don't know why that is. But then again, that's how the Australian
government demands that you round GST (consumption tax) calculations,
so there you are. I guess that it's because in the long run, assuming
even distribution of inputs, the "errors" cancel each other out.

Paul.






More information about the thelist mailing list