[Info-vax] VMS Software Q1 '23 Update
Arne Vajhøj
arne at vajhoej.dk
Thu Jan 26 13:38:03 EST 2023
On 1/26/2023 12:05 PM, Single Stage to Orbit wrote:
> On Thu, 2023-01-26 at 11:50 -0500, Dave Froble wrote:
>>> I am of the opinion that direct testing for equality of floating
>>> point numbers should be disallowed by every language and that
>>> people should be forced to use an alternative where _they_ have to
>>> specify the delta value that 2 numbers should be within before they
>>> are considered to be equal.
>>
>> Well, "have to" or not, that is the only method that works ...
>
> Or use rounding: IF Math.Round(x,2) = Math.Round(x,2) THEN ..
VB.NET?
IF Math.Round(x,2) = Math.Round(y,2) THEN
and:
IF Math.Abs(x - y) < 0.01 THEN
are not fully equivalent.
Arne
More information about the Info-vax
mailing list