Revision: 55180
http://brlcad.svn.sourceforge.net/brlcad/?rev=55180&view=rev
Author: starseeker
Date: 2013-04-18 15:32:35 +0000 (Thu, 18 Apr 2013)
Log Message:
-----------
Need much tigher tolerances in the EQ macro - FLT_EPSILON was causing
segfaults. Go with DBL_MIN to get as close as possible to the original
(working) exact comparisions without triggering compiler warnings.
Modified Paths:
--------------
brlcad/trunk/src/other/poly2tri/poly2tri/common/shapes.h
Modified: brlcad/trunk/src/other/poly2tri/poly2tri/common/shapes.h
===================================================================
--- brlcad/trunk/src/other/poly2tri/poly2tri/common/shapes.h 2013-04-18
14:47:33 UTC (rev 55179)
+++ brlcad/trunk/src/other/poly2tri/poly2tri/common/shapes.h 2013-04-18
15:32:35 UTC (rev 55180)
@@ -51,11 +51,10 @@
#include <cfloat>
#include <cmath>
-#if defined(__FLT_EPSILON__)
-# define EQ(v1, v2) ((v1 - v2 > -__FLT_EPSILON__) && (v1 - v2 <
__FLT_EPSILON__))
-#elif defined(FLT_EPSILON)
-# define EQ(v1, v2) ((v1 - v2 > - FLT_EPSILON) && (v1 - v2 < FLT_EPSILON))
-#endif
+/* Avoid exact floating point comparison warnings, but this macro
+ * is used in some places where *very* tight equality is needed -
+ * use DBL_MIN */
+#define EQ(v1, v2) ((v1 - v2 > -DBL_MIN) && (v1 - v2 < DBL_MIN))
namespace p2t {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits