Skip to content
Snippets Groups Projects
Commit 5a74efa8 authored by Esther Wang's avatar Esther Wang Committed by Milo Yip
Browse files

Fix comparision of two doubles

One of multipleOf test failed because most floating-point numbers end
up being slightly imprecise. And, the check of multipleOf with two
double numbers using the dividend (a) and the result of multiplying
the multiple after rounding down by the divisor (floor(|a|/|b|)*b) to
compare.

Change to using std::numeric_limits::epsilon to check the error of
the division result.
parent 060a09a1
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment