[geos-commits] r3907 - trunk/include/geos/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Aug 21 06:47:55 PDT 2013


Author: strk
Date: 2013-08-21 06:47:54 -0700 (Wed, 21 Aug 2013)
New Revision: 3907

Modified:
   trunk/include/geos/geom/BinaryOp.h
Log:
Use a double for PrecisionModel scale, avoiding overflows

Fixes #652

Modified: trunk/include/geos/geom/BinaryOp.h
===================================================================
--- trunk/include/geos/geom/BinaryOp.h	2013-08-21 13:44:39 UTC (rev 3906)
+++ trunk/include/geos/geom/BinaryOp.h	2013-08-21 13:47:54 UTC (rev 3907)
@@ -456,14 +456,14 @@
               << std::endl;
 #endif
 
-		long unsigned int maxScale = 1e16;
+		double maxScale = 1e16;
 
     // Don't use a scale bigger than the input one
     if ( g0scale && g0scale < maxScale ) maxScale = g0scale;
     if ( g1scale && g1scale < maxScale ) maxScale = g1scale;
 
 
-		for (long unsigned int scale=maxScale; scale >= 1; scale /= 10)
+		for (double scale=maxScale; scale >= 1; scale /= 10)
 		{
 			PrecisionModel pm(scale);
 			GeometryFactory gf(&pm);



More information about the geos-commits mailing list