Changeset 30605


Ignore:
Timestamp:
Mar 17, 2008, 12:26:03 PM (16 years ago)
Author:
1gray
Message:

raster/r.univar2/stats.c (print_stats): Fixed an integer type overflow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • grass/trunk/raster/r.univar2/stats.c

    r29904 r30605  
    138138        quartile_perc = (double *) G_calloc(stats->n_perc, sizeof(double));
    139139        for (i = 0; i < stats->n_perc; i++) {
    140             qpos_perc[i] = (int) (stats->n * stats->perc[i] / 100. - 0.5);
     140            qpos_perc[i] = (int) (stats->n * 1e-2 * stats->perc[i] - 0.5);
    141141        }
    142142        qpos_25 = (int)(stats->n * 0.25 - 0.5);
Note: See TracChangeset for help on using the changeset viewer.