[GRASSLIST:3626] Re: r.mapcalc - zero point bug

Maciek Sieczka werchowyna at pf.pl
Tue Jun 8 12:21:44 EDT 2004


> A string of digits without a decimal point is interpreted as an
> integer, which has a range of -2147483648 to 2147483647.
>
> If you add ".0" to the end (or even just "."), it will be interpreted
> as a double-precision (64-bit) floating point value, which has a range
> of approximately +/- 1.8e+308 with a precision of around 15 decimal
> digits.
>
> Also, you can specify a single-precision (32-bit) floating point value
> (range of approximately +/- 3.4e+38, with a precision of around 6
> decimal digits) by appending "f" or "F" to the value, e.g. "1.2f".
>
> This is intentional behaviour. If you wish to specify a floating-point
> constant, you have to include the decimal point.

I'm sure there are reasons that it's "intentional" but also it's not
intuitive for me and I believe for dozens like me. This may eventually get
someone into troubles, don't you agree? Is  this issue explained somewhere
in the Grass manual? I can't find it. I suggest it should be - IN CAPITALS.

Maciek




More information about the grass-user mailing list