<br><br><div class="gmail_quote">On Sun, Nov 27, 2011 at 4:57 AM, Andy Wickert <span dir="ltr">&lt;<a href="mailto:andrewwickert@gmail.com">andrewwickert@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">&gt; There can be a significant performance hit for doing this. Checking<br>
&gt; whether the result of an addition overflowed is actually more<br>
&gt; expensive than the addition itself. Checking whether a multiplication<br>
&gt; overflowed can be even worse (particularly if you don&#39;t have a 64-bit<br>
&gt; integer type available).<br>
&gt;<br>
&gt; --<br>
&gt; Glynn Clements &lt;<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>&gt;<br>
&gt;<br>
<br>
</div>Hm. If that&#39;s a debilitating issue, </blockquote><div><br>I agree. And it should actualy not happen or at least a warning should be given.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
perhaps the overflow check could<br>
be triggered by a flag (e.g., if the user thinks there may be a<br>
problem) </blockquote><div><br>That would be the minimum - I would even opt for an environmental variable GRASS_CHECK_OVERFLOW which provides overflow checking globally for all functions which can produce an overflow. r.mapcalc would be the obvious candidate, but there are others which *can* produce overflow and which should be checking for overflow as well.  <br>
<br>GRASS_CHECK_OVERFLOW could have three values:<br> - unset or &quot;NO&quot; (default): do not check for overflow (the default as it is now)<br> - &quot;error&quot;: check and raise an error if overflow occurs<br> - &quot;warning&quot;: check and produce a warning if overflow occurs.<br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">or (easier) some information on typing and overflow could be<br>
placed on the man page.<br></blockquote><div><br>I don&#39;t think that is enough - I solved the problem on my side by using double instead of integer, but it took me some time to figure out why my results were wrong. So: Yes, there should definitely be a warning in the manual (highlighted and in Bold so that even I would have seen it...), but the option to check and raise an error on overflow should be provided.<br>
<br>And as an environmental variable, it could be used by all modules.<br><br>Cheers,<br><br>Rainer<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<span class="HOEnZb"><font color="#888888"><br>
Andy<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)<br><br>Centre of Excellence for Invasion Biology<br>
Stellenbosch University<br>South Africa<br><br>Tel :       +33 - (0)9 53 10 27 44<br>Cell:       +33 - (0)6 85 62 59 98<br>Fax (F):       +33 - (0)9 58 10 27 44<br><br>Fax (D):    +49 - (0)3 21 21 25 22 44<br><br>email:      <a href="mailto:Rainer@krugs.de" target="_blank">Rainer@krugs.de</a><br>
<br>Skype:      RMkrug<br><br>