[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Numbers




    Now I'm sure that about half of you are shouting at your terminal about how
    I couldn't -possibly- mean that, but I do.  Understand me once and for all:

			  INEXACT NUMBERS ARE NOT NUMBERS

			  INEXACT NUMBERS ARE NOT NUMBERS

			  INEXACT NUMBERS ARE NOT NUMBERS

    They do not obey the rules followed by numbers, because they cannot.
    Inexact numbers only represent our -approximate- -knowledge- about numbers.
    In

      (max 1.0 549755813889)  ==>  549755813888.0

    we strongly suspect that the first number is 1, but we don't know for sure.
    Thus we strongly suspect that the answer is 549755813889, but again we
    don't know for sure (the first number could have actually been
    549755813890).  Since we don't know the answer for sure, we must return an
    inexact representation of our best guess.  549755813888.0 is the closest we
    can come.  (The next larger might be 549755879424.0, assuming 23 bits of
    floating point precision, which is not very close at all.)

I'd rather see SUP/MAX reutrn the larger answer, than the numerically
closer answer.  I use MAX rarely, and I think I've always intended it
to mean "something no smaller than any of its arguments".

    Indeed, we could -specify- that MAX always ``round up'' in the inexact case
    so that the result always appears greater (accroding to `<') than any of
    the arguments.  This would be similar to specifying that `<' must always
    behave transitively.  It would be a feeble attempt on our part to paper
    over the ugly fact that -in- -general-, inexact numbers do not obey the
    axioms of arithmetic.

However feeble, it would provide for a somewhat more intuitive and
predictable model.  In the absence of detailed information about the
representation(s) of inexact numbers in a given implementation, and
the rounding algorithms using by min/max, I can't expect anything in
particular about the result value using your (and Will's) model.
Using the feeble constraint, I can at least bound the result.