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

posted by mittyri – Russia, 2019-07-20 22:43 (496 d 08:11 ago) – Posting: # 20416
Views: 4,761

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,215 posts in 4,427 threads, 1,482 registered users;
online 8 (0 registered, 8 guests [including 5 identified bots]).
Forum time: Saturday 05:54 CET (Europe/Vienna)

Science may be described as the art of systematic over-simplification –
the art of discerning what we may with advantage omit.    Karl R. Popper

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