mirror of
https://github.com/jhasse/poly2tri.git
synced 2025-08-04 14:25:40 +02:00
Use std::fpclassify for double==0 tests
This commit is contained in:
@@ -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
|
// Using a tolerance here fails on concave-by-subepsilon boundaries
|
||||||
// if (val > -EPSILON && val < EPSILON) {
|
// 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;
|
return COLLINEAR;
|
||||||
} else if (val > 0) {
|
} else if (val > 0) {
|
||||||
return CCW;
|
return CCW;
|
||||||
|
Reference in New Issue
Block a user