floating-point math is always more complex than you think it is [Software]

posted by mittyri – Russia, 2019-07-20 22:43 (1124 d 23:44 ago) – Posting: # 20416
Views: 11,283

Hi ElMaestro,

» Match(6, 6.001, 0.01)
» Ugly as hell :vomit:, and will not work well if you get into extreme binary representations.

take a look at
if (Abs(x - y) <= absTol * Max(1.0f, Abs(x), Abs(y)))
the description is here

One may consider ULP, pros and cons described here

Kind regards,

Complete thread:

UA Flag
 Admin contact
22,305 posts in 4,668 threads, 1,587 registered users;
online 6 (0 registered, 6 guests [including 3 identified bots]).
Forum time: Thursday 22:27 CEST (Europe/Vienna)

On two occasions I have been asked,—“Pray, Mr. Babbage,
if you put into the machine wrong figures,…
will the right answers come out?”
I am not able rightly to apprehend the kind of confusion of ideas
that could provoke such a question.    Charles Babbage

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz