Rounding to the nearest even value
Author Message
Rounding to the nearest even value

released on Thu, 21 Feb 2002 07:26:03 -0800 bearing the
following fruit:

Quote:
>When using Cint or Clng the value rounds to the nearest
>even value. (Which is documented)

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

Quote:
>The Round function has the same result.  Is there anything

I think you may be talking about bankers rounding, it is
documented in KB articles

see

Q196652
Q194983

J

Mon, 09 Aug 2004 23:50:03 GMT
Rounding to the nearest even value

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). So cint(1.2) yields a 1. 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

Wed, 11 Aug 2004 06:52:06 GMT
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

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

Fri, 13 Aug 2004 17:33:19 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages