[Info-vax] VMS Software Q1 '23 Update

Arne Vajhøj arne at vajhoej.dk
Sat Jan 28 09:27:46 EST 2023


On 1/28/2023 12:46 AM, Steven Schweda wrote:
>> I am not saying that one is better than the other [...]
> 
>     I am.  A reasonable test for approximate equality looks for a "small"
> (absolute) difference between two values.

Absolute difference is sensitive to the scale
of the data.

Sometimes relative difference makes more sense.

>                                     Expecting two extremely close
> values to round to the same value is not reasonable.  (That is, it
> doesn't always happen.)
 >
>     "Equal when rounded" might seem plausible at first glance, but (even)
> a little thought would reveal that it's an inferior test (because it
> gives goofy results for values close to a round-down/up decision value).

Consider the case where the numbers represent money.

The difference between 2.494 dollar/euro and 2.496 dollar/euro
are less than 0.01 but ...

Arne




More information about the Info-vax mailing list