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
>documented about this???

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
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



Fri, 13 Aug 2004 17:33:19 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. rounding numbers up to nearest even 2000

2. Rounding to Nearest Even Number

3. I want to round a number to the nearest order of 10

4. Rounding to the nearest 5

5. Rounding integers to the nearest 1000.

6. Rounding to nearest 5 cents

7. Round time to nearest quarter

8. How to round numbers to the next integer even if they are under .5

9. Set value in the textbox when OnSelectedIndexChanged even happen

10. Why a textbox shows/retains value bwtween calls even after being reset

11. why the round function return different value?

 

 
Powered by phpBB® Forum Software