[GRASS-SVN] r50195 - grass/trunk/vector/v.mapcalc

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 14 20:24:30 EST 2012


Author: hamish
Date: 2012-01-14 17:24:30 -0800 (Sat, 14 Jan 2012)
New Revision: 50195

Modified:
   grass/trunk/vector/v.mapcalc/README
   grass/trunk/vector/v.mapcalc/vector.c
Log:
more defined way of creating a nan (#1321, merge from devbr6)

Modified: grass/trunk/vector/v.mapcalc/README
===================================================================
--- grass/trunk/vector/v.mapcalc/README	2012-01-15 01:24:19 UTC (rev 50194)
+++ grass/trunk/vector/v.mapcalc/README	2012-01-15 01:24:30 UTC (rev 50195)
@@ -37,7 +37,7 @@
 point lists are meant in the mathematical sense: A point is a set of
 two or three numbers, representing the coordinate. All points have
 three components, but the third, if missing has the value of
-sqrt(-1). An expression will yield a 3D result if all arguments a
+0.0/0.0 (NaN). An expression will yield a 3D result if all arguments a
 3D. There is a set of basic builtin operations like dot and cross
 product. Point lists are meant for polygons, lines, areas, etc. Points
 and point lists have no categories or attributes. And finally, of
@@ -192,7 +192,7 @@
          2 * (3.1 + 0.9);
 
 Next are points. Note that 2D and 3D are dealt with identically; in
-case of 2D, the z-value is sqrt(-1) (NaN, "Not a Number"). This should
+case of 2D, the z-value is 0.0/0.0 (NaN, "Not a Number"). This should
 be pretty portable. Generally, if at least one point is 2D, the result
 of a point operation will be 2D even if 3D points are involved too,
 ignoring the third dimension. I've defined some infix operations a bit

Modified: grass/trunk/vector/v.mapcalc/vector.c
===================================================================
--- grass/trunk/vector/v.mapcalc/vector.c	2012-01-15 01:24:19 UTC (rev 50194)
+++ grass/trunk/vector/v.mapcalc/vector.c	2012-01-15 01:24:30 UTC (rev 50195)
@@ -124,7 +124,7 @@
     sym->v.p = &pnt_k;
 
     /* initialize NaN */
-    nanval = sqrt(-1);
+    nanval = 0.0 / 0.0;
 }
 
 void printvec(SYMBOL * sym)



More information about the grass-commit mailing list