<br><br>On Wednesday, May 15, 2013, Glynn Clements  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Paulo van Breugel wrote:<br>
<br>
> I am having trouble with the following computation, which gives me an<br>
> overflow warning ("WARNING: Overflow occured in the calculation").<br>
><br>
> r.mapcalc "A = if(B==0, (round(C/0.0001)-1175699902)/(3007966667-1175699902) *100.0, 1)" --overwrite<br>
><br>
><br>
> whereby C is a map with values between 1 and 31000. It seems to be<br>
> related to the size of the numbers (no warning if I divide C by 0.001),<br>
> but I am not clear what limit I am hitting here or how to avoid this.<br>
><br>
> The warning does not stop the calculation, and the resulting map seems<br>
> to be correct. However, I rather avoid this warning, also because the<br>
> warning message causes problems when running in batch from within R.<br>
<br>
The round() function always returns an integer, regardless of its<br>
argument types. Integers are always 32-bit, so the result is limited<br>
to the range +/- 2147483647 (2^31-1).</blockquote><div><br></div><div>True - but is there an equivalent function to round numbers outside the integer range? Would be useful. Looking at the functions in r.mapcalc, I can't think of a way of doing this?</div>
<div><br></div><div>Rainer<span></span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
--<br>
Glynn Clements <<a href="javascript:;" onclick="_e(event, 'cvml', 'glynn@gclements.plus.com')">glynn@gclements.plus.com</a>><br>
_______________________________________________<br>
grass-dev mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'grass-dev@lists.osgeo.org')">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</blockquote><br><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>