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

posted by mittyri – Russia, 2019-07-21 00:43 (1712 d 23:07 ago) – Posting: # 20416
Views: 13,705

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,
Mittyri

Complete thread:

UA Flag
Activity
 Admin contact
22,957 posts in 4,819 threads, 1,636 registered users;
86 visitors (0 registered, 86 guests [including 3 identified bots]).
Forum time: 22:50 CET (Europe/Vienna)

Nothing shows a lack of mathematical education more
than an overly precise calculation.    Carl Friedrich Gauß

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