Subject: Comparing numbers with different precisions
From: Clint Redwood <clint@xxxxxxxxxxxxxxx>
Date: Thu, 9 Feb 2012 09:24:28 +0000
|
Hi!
I've a slightly awkward comparison, where I have two numbers of differing
precisions, and I want to regard them as the same if the less preicse is the
more precise rounded down to the same precision.
Examples are:
17.166666666666668 ~= 17.1666666666667
and
8.333333333333334 ~= 8.33333333333333
Unfortunately, the precision is not always the same for all the numbers I'm
trying to compare.
I just wondered if anyone on this list had done anything similar, and had a
good way of doing it, while I try and figure out a suitable way to do it.
Yours,
Clint Redwood.
|