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

posted by mittyri – Russia, 2019-07-20 20:43 (587 d 04:13 ago) – Posting: # 20416
Views: 6,477

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,357 posts in 4,459 threads, 1,492 registered users;
online 12 (0 registered, 12 guests [including 3 identified bots]).
Forum time: Saturday 00:56 UTC (Europe/Vienna)

The way to do research is to attack the facts
at the point of greatest astonishment.    Celia Green

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