[GRASS-dev] r.mapcalc division by 0
Glynn Clements
glynn at gclements.plus.com
Sun Jan 21 11:35:31 EST 2007
Helena Mitasova wrote:
> I noticed that the man page for r.mapcalc gives confusing
> information about division by 0. It says:
>
> Division by 0 and modulus by 0 are acceptable and give a 0 result.
>
> but later on:
> Division by zero should result in NULL.
>
> I tried it and the second is true (it results in NULL)
>
> And then there is an example
>
> To produce a binary representation of the raster map layer a so that
> category 0 remains 0 and all other categories become 1:
> mask = a/a
>
> but what you get is a map with 1 and NULL.
>
> I assume these are leftovers from pre-NULL times?
Most likely. Fixed in CVS.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list