(Also posted, in error, to IBM-MAIN)
The most recent post of Don Higgins is in some ways a very sensible and useful
one; in some other ways it is less so.
An irrational number is one that is NOT expressible as the quotient of two
integers, and the number 1/3 is thus a rational, unambiguously so.
The difficulties that arise with floating-point numbers are of a different
sort. Let's look at the successive rationals 1/1, 1/2, 1/3, 1/4, 1/5, 1/6, . .
. Their decimal expansions
1.0
1.5
1.3333333333333...
1.25
1.6666666666666...
. . .
fall into two classes, terminating and non-terminating repeating. Which is
which is a function not just of numerator and denominator but also of the base,
typically one of 2, 10, or 16, in which an expansion is expressed. A rational
that has a terminating decimal expansion may have a non-terminating hexadecimal
expansion and vice versa.
Most non-mathematicians are familiar only with the decimal ones, and they
understandably confound the municipal properties of these decimal expansions
with properties of the universe. The results of some binary or hexadecimal
operations look not just different but wrong to them when these results depart
slightly from their decimally conditioned expectations.
This is the real thrust of Mike Cowlishaw's argument for the use of DFP: It can
be made to yield, in his implementation does yield, results that are more
congenial to naif decimal expectations than those that BFP and HFP yield.
DFP has indeed been caricatured as "floating-point for clots". Conformity with
naif expectations is nevertheless a highly desirable property in some contexts,
but it must not be confused with accuracy or virtue. DFP has important uses
in, say, bank Demand Deposit Accounting. For scientific and engineering
computations BFP is superior, and it is more efficient in general.
Don's example of a Florida tax-calculation rounding rule is one of many such.
The insurance commissions of many states specify 'penny-breakage' rules for
insurance calculations that are different in different states. This is perhap a
little unfortunate, buit it reflects historic experience: many companies will
use intellectually indefensible rounding conventions that favor them over their
customers, suppliers, and employees if they judge that they can get away with
doing so.
For the record, irrationals are numbers that are not expressible as rational
fractions. The Greek geometers noted them early on, although not before their
Babylonian predecessors. The hypotenuse of a unit equilateral right triangle
has the length sqrt(1**2 + 1**2) = sqrt(2), which is irrational, has the
non-terminating and non-repeating decimal expansion
1.41421_35623_73095_04880_16887_24209_69807_...
There is, moreover, a further distinction that has tripped up some posters here
in the past. A merely irrational number, which is always one of the zeros of a
polynomial having rational coefficients, needs to be distinguished from a
transcendental number like pi or e, which is not.
John Gilmore Ashland, MA 01721-1817 USA