[GRASS-SVN] r38854 - grass/branches/develbranch_6/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 25 03:47:33 EDT 2009


Author: hamish
Date: 2009-08-25 03:47:33 -0400 (Tue, 25 Aug 2009)
New Revision: 38854

Modified:
   grass/branches/develbranch_6/lib/gis/trim_dec.c
Log:
don't trim e+20 into e+2 (trac #720; incurs a 2.5% performance hit)

Modified: grass/branches/develbranch_6/lib/gis/trim_dec.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/trim_dec.c	2009-08-25 07:34:39 UTC (rev 38853)
+++ grass/branches/develbranch_6/lib/gis/trim_dec.c	2009-08-25 07:47:33 UTC (rev 38854)
@@ -14,6 +14,7 @@
  * \date 1999-2008
  */
 
+#include <string.h>
 #include <grass/gis.h>
 
 
@@ -30,6 +31,10 @@
 {
     char *mark;
 
+    /* don't trim e+20 into e+2 */
+    if( strchr(buf, 'e') || strchr(buf, 'E') )
+	return 0;
+
     /* find the . */
     while (*buf != '.')
 	if (*buf++ == 0)



More information about the grass-commit mailing list