Mathieu Bouchard <[EMAIL PROTECTED]> wrote on 7/31/01 12:28 am:
>On Sun, 15 Jul 2001, Gary
>Kenneth Krueger wrote:
. . .
. . .
. . .
>> If anyone is going to be writing conversion capabilities into a
>> language, error values should be propagated with the converted
>> numbers. That is, there are exact conversions that introduce no error
>> (feet to inches & meters to centimeters). And there are conversions
>> that are only accurate to a few decimal places (centimeters to inches
>> & pounds to kilograms).
>It can be asserted that a
>pound is 454 grams and be
>done with it. If you
>want to propagate errors
>then you need a whole other
>framework layered on
>top of that, that say e.g. +/-
>0.5 grams error margin.
Although it should not be presumed that the positive error is necessarily equal to the
negative error.
Error propagation needs to be easy enough to use so that it basically comes along with
the calculations (maybe selected via a switch). Otherwise it becomes too unwieldy,
because you need to backtrack by applying changes to every calculation that leads to
your result once you`ve decided that you need to calculate error. It is sounding more
like a built-in language feature than some sort of add-on module.
>However (as was told on
>ruby-talk later) there's the
>problem that for v =
>a +/- b, then v-v = 0 +/- 2b,
>unless the system is smart
>enough to cancel
>errors where it can, and this
>is difficult, especially in
>hairier
>situations where the
>cancellations come
>indirectly. Of course this
>only
>really matters if you end up
>with insanely high error
>margins.
Normally in science, you are only interested in an outside error estimate, and just
need to be mindful when coding mathematical functions so as not to introduce
unnecessary cancellation errors.
>A system without the smart
>cancellations, should be easy
>enough to write
>(possibly less code than the
>units stuff),
It should be reasonable to presume that cancellation may be neglected.
>but it all
>depends on how many
>wrappers you are willing to
>write, since *most*
>low-level code (assuming
>C), and *some* high-level
>code (assuming Ruby), will
>not work with
>units/margins properly and
>will have to be wrapped
>manually or
>semi-automatically.
-- :) -- 8-) -- ;-) -- :-o
Gary Kenneth Krueger
[EMAIL PROTECTED]