[GRASS5] r.contour crashes if step=0.5

Markus Neteler neteler at geog.uni-hannover.de
Sat Jan 27 07:33:29 EST 2001


[cc to grass5]
On Sat, Jan 27, 2001 at 12:48:44PM +0100, Roger Bivand wrote:
> On Sat, 27 Jan 2001, Markus Neteler wrote:
> > Hi developers,
> > 
> > r.contour crashes if step=0.5... Floating point exception.
> > I actually cannot see the problem. The offending line is a macro:
> > 
> >   dmax = (max->answer) ? atof (max->answer) : zmax - (int)zmax%(int)dstep;
> > 
> > dstep contains 0.5, zmax is determined my the program zmax=7.1231 here).
> > 
> It's the (int) cast on dstep, which becomes integer 0, and which gives a
> NaN when used for division. For this code to work, dstep must be >= 1. It
> looks a bit cludgy too.

I see. But in my case I have a map with pH values ranging from 5.5 to
7.3. So setting "step" to 1 doesn't produce exciting contours.
Even step is a double. Se we might need to change this line (and the next
in main.c of r.contours)?

Thanks for your quick reply

If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'

More information about the grass-dev mailing list