Re: Rounding off in AppleScript
Re: Rounding off in AppleScript
- Subject: Re: Rounding off in AppleScript
- From: "Dennis W. Manasco" <email@hidden>
- Date: Thu, 14 Apr 2005 05:01:37 -0500
At 2:05 AM +0100 4/14/05, Nigel Garvey wrote:
It also rounds 0.5 up
Please don't do this.
(Unless you're doing financials and trying to figure out how much you
owe the government in fica or whatever.)
Despite the preposterously inane advice drummed into many a
grade-schooler's head by math teachers who should have stuck to their
primary jobs as phys.-ed. instructors, always rounding up (or down)
from 5 x 10 ^ -x is a sincerely bad idea.
It can badly sk(r)ew many statistical analyses, and leaves a nasty
taint on the rest.
The consistently applied up (or down) rounding adds a
quasi-mathematical bias to the analysis. This bias can even be used
to fraudulently "prove" an assertion in datasets which would
otherwise return a statistically insignificant result.
For almost any use the always-round-up (or down) approach is a very
bad an idea.
(Unless you're figuring tax numbers and want to avoid having to keep
track of partial cents and paying $100 penalties + interest + etc.)
whereas 'round' - without an appallingly named parameter - rounds it
to the nearest even.
Good.
Round-to-even, round-to-odd, it doesn't matter so long as you are
consistent in all calculations that ever touch the dataset.
Round-to-even seems to be the standard that most people have settled
on. I believe it's the paradigm required for IEEE compliance.
(Why didn't Apple loudly proclaim and explain their IEEE compliance
in the early '80s when MS was still vulnerable to assertions of
inferior mathematics? That's one of my favorite examples of a missed
opportunity....)
-=-Dennis
.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden