[GRASS-dev] r.univar -g: output total as well

Hamish hamish_b at yahoo.com
Thu Aug 20 06:57:16 EDT 2009

> > does that %d (and n= and null_cells= above it) want to be %ld or
> > something to be LFS-safe?
> > fprintf(stdout, "cells=%d\n", stats->size);
> >
> > e.g. IIUC signed int overflows at a sqrt(2^31) = 46341 x 46341
> > rows x cols raster region size. Which people are getting closer to
> > these days...

Markus wrote:
> Right - I guess that the entire output of r.univar needs to be revised
> for that.

not just the output, the innards as well. I see in global.h that both
n and size are plain signed int. Not sure why n was changed away from
being unsigned int, it used to be like that in the original C version.
(unsigned int would survive up to 65536x65536 cells, IIUC)

Also, I've been wondering whether to apply the %.7g for FCELL, %.15g
for DCELL output formats for r.univar min/max/stdev output as part of
trac #335.



More information about the grass-dev mailing list