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

Request Tracker grass-bugs at intevation.de
Mon Aug 14 05:13:59 EDT 2006


this bug's URL: http://intevation.de/rt/webrt?serial_num=4998
-------------------------------------------------------------------------

Subject: r.mapcalc rand (a,b): b-1 is used instead of b

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 2006-08-12

The rand (a,b) function in r.mapcalc uses the (b-1) instead of b:

$ r.mapcalc 'map=rand(1,100)'
$ r.info -r map
min=1
max=99
    ^
    |
  should be 100!

And if the min and max are equal, r.mapcals goes into some infinite loop:

$ r.mapcalc 'map=rand(1,1)'
   0%
   ^
   |
  no progress whatever, 100% CPU used

Maciek


-------------------------------------------- Managed by Request Tracker




More information about the grass-dev mailing list