From 30279f701c2e1bc976b5e91d67c52a8de1191ebe Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Wed, 16 Mar 2022 08:35:34 -0500 Subject: [PATCH] Use std::fpclassify for double==0 tests --- poly2tri/common/utils.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/poly2tri/common/utils.h b/poly2tri/common/utils.h index 1479fb5..6a20a00 100644 --- a/poly2tri/common/utils.h +++ b/poly2tri/common/utils.h @@ -71,7 +71,8 @@ Orientation Orient2d(const Point& pa, const Point& pb, const Point& pc) // Using a tolerance here fails on concave-by-subepsilon boundaries // if (val > -EPSILON && val < EPSILON) { - if (val == 0) { +// Using == on double makes -Wfloat-equal warnings yell at us + if (std::fpclassify(val) == FP_ZERO) { return COLLINEAR; } else if (val > 0) { return CCW;