[GRASS-dev] [bug #4998] (grass) r.mapcalc rand (a, b): b-1 is used instead of b

Maciej Sieczka tutey at o2.pl
Tue Aug 15 09:30:01 EDT 2006


Glynn Clements napisa?(a):

> Using partitions which are closed at both ends results in overlapping
> partitions (i.e. the boundary points belong to both), while partitions
> which are open at both ends result in gaps (i.e. the boundary points
> belong to neither).

Glynn,

Right. I haven't thought of it.

On the other hand, if one needs an FP random number from a closed range
eg. <1,100> (I mean - including the max value) given how rand is
currently implemented in r.mapcalc this cannot be achieved. He will get
all values <1,100), ie. all but 100 itself.

Thanks to your explanations I understand now this problem should be
rather considered as a wish. Would it be hard to implement both closed
and open ranges, as well as their combinations, in r.mapcalc's rand?

Maciek




More information about the grass-dev mailing list