[GRASS-SVN] r57770 - grass/branches/releasebranch_6_4/vector/v.mapcalc
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Sep 20 18:33:04 PDT 2013
Author: hamish
Date: 2013-09-20 18:33:03 -0700 (Fri, 20 Sep 2013)
New Revision: 57770
Modified:
grass/branches/releasebranch_6_4/vector/v.mapcalc/Makefile
grass/branches/releasebranch_6_4/vector/v.mapcalc/README
grass/branches/releasebranch_6_4/vector/v.mapcalc/vector.c
Log:
more defined way of creating a nan (#1321), move Makefile a little closer to the GRASS way (merge r50193,4 from devbr6)
Modified: grass/branches/releasebranch_6_4/vector/v.mapcalc/Makefile
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.mapcalc/Makefile 2013-09-21 01:27:55 UTC (rev 57769)
+++ grass/branches/releasebranch_6_4/vector/v.mapcalc/Makefile 2013-09-21 01:33:03 UTC (rev 57770)
@@ -1,4 +1,6 @@
-CC = gcc
+MODULE_TOPDIR = ../..
+PGM = v.mapcalc
+
#CFLAGS = -g -Wall -Werror -rdynamic
CFLAGS = -O2 -Wall -Werror -rdynamic
LDFLAGS = -ldl -lm #-lefence
@@ -6,6 +8,11 @@
#YACC = bison -t
YACCFLAGS = -d
+LIBES = $(VECTLIB) $(GISLIB)
+DEPENDENCIES = $(VECTDEP) $(GISDEP)
+EXTRA_INC = $(VECT_INC)
+EXTRA_CFLAGS = $(VECT_CFLAGS)
+
all: v.mapcalc
v.mapcalc: mapcalc.o yylex.o v.mapcalc.o number.o vector.o map.o any.o \
Modified: grass/branches/releasebranch_6_4/vector/v.mapcalc/README
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.mapcalc/README 2013-09-21 01:27:55 UTC (rev 57769)
+++ grass/branches/releasebranch_6_4/vector/v.mapcalc/README 2013-09-21 01:33:03 UTC (rev 57770)
@@ -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/branches/releasebranch_6_4/vector/v.mapcalc/vector.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.mapcalc/vector.c 2013-09-21 01:27:55 UTC (rev 57769)
+++ grass/branches/releasebranch_6_4/vector/v.mapcalc/vector.c 2013-09-21 01:33:03 UTC (rev 57770)
@@ -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