[GRASS5] [bug #906] (grass) r.mapcalc: sqrt(-1) - oops

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

Subject: r.mapcalc: sqrt(-1) - oops

grass downloaded at: CVS Server, Germany

Hi,

to ensure, that people trust r.mapcalc, this one should not
happen:

r.mapcalc oops="sqrt(-1)"
EXECUTING oops = ... 100%
CREATING SUPPORT FILES FOR oops
range: -1 -1

r.mapcalc oops2="sqrt(-3)"

EXECUTING oops2 = ... 100%
CREATING SUPPORT FILES FOR oops2
range: -1.732051 -1.732051

Markus

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

(cc GRASS5)

On Wed, Jan 23, 2002 at 09:55:52AM +0000, Glynn Clements wrote:

Markus Neteler wrote:

> > When talking about r.mapcalc bugs it happened to me few times that r.mapcalc
> > computed an expression even if one of the maps did not exist without any
> > complaint.
> > I did not have time to investigate, but if it really happens it is a pretty
> > dangerous behavior.
>
> Glynn has fixed the sqrt() problem last night. Please post those case, Helena,
> if you come across. Of course above error is not acceptable as
> you just get wrong results.
>
> Glynn, could you revisit r.mapcalc?

I'll look into it if I'm given a reproducible test case.

BTW, is there any particular reason for r.mapcalc's use of an
intermediate reverse-Polish representation?

... about the implementation I do not have much ideas. As
far as I know it is quasi unchanged for years except a few
fixes, the FP extension and cat label copies.
So it might be a candidate for improvement.

Markus