Re: Pixel Mania
- From: "Michael C" <nospam@xxxxxxxxxx>
- Date: Mon, 30 Apr 2007 13:40:40 +1000
"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote in
message news:OUVJ3ItiHHA.4516@xxxxxxxxxxxxxxxxxxxxxxx
Remember, Banker's Rounding (round-to-even) only comes into play when the
number ends exactly in 5 (only zeroes after it is fine) and your are
rounding up to the position in front of the 5... that will never be the
case with Pi as it is an irrational, transcendental number which has an
infinite number of decimal digits following the decimal point.
That is true.
I'm not so sure Banker's Rounding comes into play here either. The 16 bit
truncated number that VB rounds to 15 displayed digits is an integer power
of two (I think it is only considered as a decimal if the power of ten is
negative), so I don't think it can end in exactly 5.
It can. The number 5 ends in a 5. So does 0.5.
But even if it did, I don't think rounding in the 15th digit would screw
up anyone's calculations. The problem is when VB applies the Banker's
Rounding in situations one doesn't expect. One example of this is 'integer
division'... most people would think A\B means Int(A\B)... but it doesn't.
VB interprets it as Int(Round(A)/Round(B)).
Most people would expect it to round first IMO. It's integer division. In
all my time I've never even considered using it with non integers.
Michael
.
- Follow-Ups:
- Re: Pixel Mania
- From: Rick Rothstein \(MVP - VB\)
- Re: Pixel Mania
- References:
- Pixel Mania
- From: Mike Williams
- Re: Pixel Mania
- From: David Youngblood
- Re: Pixel Mania
- From: Jim Mack
- Re: Pixel Mania
- From: Rick Rothstein \(MVP - VB\)
- Re: Pixel Mania
- From: Jim Mack
- Re: Pixel Mania
- From: Rick Rothstein \(MVP - VB\)
- Re: Pixel Mania
- From: Steve Gerrard
- Re: Pixel Mania
- From: Mike Williams
- Re: Pixel Mania
- From: Robert Morley
- Re: Pixel Mania
- From: David Youngblood
- Re: Pixel Mania
- From: Rick Rothstein \(MVP - VB\)
- Pixel Mania
- Prev by Date: Re: Pixel Mania
- Next by Date: Re: Pixel Mania
- Previous by thread: Re: Pixel Mania
- Next by thread: Re: Pixel Mania
- Index(es):
Relevant Pages
|