BBS: Inland Empire Archive
Date: 02-18-93 (19:34) Number: 266
From: JIM LITTLE Refer#: NONE
To: HUGH MARTIN Recvd: NO
Subj: Help Conf: (2) Quik_Bas
HM>DC> You learn the d*mnest things, by tinkering...
HM>It's amazing how many bugs and "features" are in QB 4.5. I just ran into a
HM>one converting a stats program from QB 3.0 to 4.5. Turns
HM>out that QB 4.0 and above (even PDS!) can't round numbers properly.
HM>According to them, CINT(30.5) = 30, but lowly QB 3.0 correctly rounds
HM>up to 31. Thank you, Microsoft, for wasting another hour of my time.
HM>Does VB/DOS round numbers correctly, or is this bug impervious to
My two cents:
Some time ago, all the mathemeticians of the world got together
for one of their big
and decided that rounding was not very accurate. They had already
decided that if you round XX.5x, it should be rounded up, because its
definitely greater than .5. However, if the number is XX.5, it's right
right to just arbitrarily round up or down ALL the time, because that
would introduce an error (a small one, but an error all the same..) into
the calculations (eventually). Well, these great mathematicians thought
about this for a couple days, then decided that if
is EVEN, you round DOWN. If it's ODD, you round UP. So...
30.5 = 30 30.50001 = 31 31.5 = 32
Now, that nasty little error has been taken care of, because
statistically, the chances of an even or odd number occuring are
Once the geniuses of the mathematical world figured this out, they
finished up their conference and went home, satisfied that they had done
some good in the world. <Grin>
Well, obviously Microsoft decided to
in between version 3.0 and 4.5. If you really need to round the
way, I would suggest INT(number! + .5).
Here to brighten your day
* SLMR 2.1a * Nothing is so smiple that it can't get screwed up.
--- WM v2.07/91-0012
* Origin: Com-Dat BBS Hillsboro, OR. HST (503) 681-0543 (1:105/314)