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

posted by mittyri – Russia, 2019-07-20 22:43 (740 d 10:36 ago) – Posting: # 20416
Views: 8,346

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:

Activity
 Admin contact
21,592 posts in 4,514 threads, 1,532 registered users;
online 14 (0 registered, 14 guests [including 4 identified bots]).
Forum time: Friday 09:19 CEST (Europe/Vienna)

It is a capital mistake to theorise before one has data.    Arthur Conan Doyle

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