[GRASS-SVN] r30384 - grass/trunk/raster/r.univar2
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 28 05:42:09 EST 2008
Author: 1gray
Date: 2008-02-28 05:42:09 -0500 (Thu, 28 Feb 2008)
New Revision: 30384
Modified:
grass/trunk/raster/r.univar2/r.univar_main.c
Log:
raster/r.univar2/r.univar_main.c (process_raster): Added proper casts to
`double' within the `CELL' and `FCELL' branches.
Modified: grass/trunk/raster/r.univar2/r.univar_main.c
===================================================================
--- grass/trunk/raster/r.univar2/r.univar_main.c 2008-02-28 10:33:25 UTC (rev 30383)
+++ grass/trunk/raster/r.univar2/r.univar_main.c 2008-02-28 10:42:09 UTC (rev 30384)
@@ -211,7 +211,7 @@
const int val_i = *((CELL *) ptr);
stats->sum += val_i;
- stats->sumsq += (val_i * val_i);
+ stats->sumsq += (double) val_i * val_i;
stats->sum_abs += abs(val_i);
if (param.extended->answer)
@@ -233,7 +233,7 @@
const float val_f = *((FCELL *) ptr);
stats->sum += val_f;
- stats->sumsq += (val_f * val_f);
+ stats->sumsq += (double) val_f * val_f;
stats->sum_abs += fabs(val_f);
if (param.extended->answer)
More information about the grass-commit
mailing list