mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-26 07:16:11 +01:00
Use std::fpclassify for double==0 tests
This commit is contained in:
parent
19ec7c78a1
commit
30279f701c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user