Rounding to the nearest even value

wild thoughts were released on Fri, 22 Feb 2002 15:52:06

-0700 bearing the following fruit:

Quote:

>> by that rule cint(1.2) would = 2 ??

>No, the Banker's Rounding rule (nearest even value) only applies when the

>fractional part is exactly 0.5 (i.e., 1/2).

Yep, I know, that was kinda my point, the behaviour reported

by the original poster does not occur, as you point out in

your next statement.

Quote:

>So cint(1.2) yields a 1.

Bankers rounding is the nearest thing that I can think of

that might be what the poster is refering to.

J

Quote:

>Even

>1.499999 comes to 1. So, it isn't quite as bad as it may seem, unless you're

>working with numbers that come out to some integer+0.5 (exactly) a lot.

>Then, the results can seem a little weird and inconsistent, from a certain

>point of view, but more accurate from another viewpoint -- a banker's, I

>guess.

>--

>Russ Holsclaw