<div dir="ltr"><div>I would second that, it certainly would be handy to be able to round numbers outside the integer range and in addition, rounding with a specific number of decimal places, like e.g., the function round() in R. Is there a specific reason the round() function results in an integer? <br>
<br></div>Paulo<br><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 15, 2013 at 9:20 PM, Rainer M Krug <span dir="ltr"><<a href="mailto:r.m.krug@gmail.com" target="_blank">r.m.krug@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><br>On Wednesday, May 15, 2013, Glynn Clements  wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
--<br>
Glynn Clements <<a>glynn@gclements.plus.com</a>><br>
_______________________________________________<br>
grass-dev mailing list<br>
<a>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 :       <a href="tel:%2B33%20-%20%280%299%2053%2010%2027%2044" value="+33953102744" target="_blank">+33 - (0)9 53 10 27 44</a><br>Cell:       <a href="tel:%2B33%20-%20%280%296%2085%2062%2059%2098" value="+33685625998" target="_blank">+33 - (0)6 85 62 59 98</a><br>
Fax (F):       <a href="tel:%2B33%20-%20%280%299%2058%2010%2027%2044" value="+33958102744" target="_blank">+33 - (0)9 58 10 27 44</a><br><br>Fax (D):    <a href="tel:%2B49%20-%20%280%293%2021%2021%2025%2022%2044" value="+4932121252244" target="_blank">+49 - (0)3 21 21 25 22 44</a><br>
<br>email:      <a href="mailto:Rainer@krugs.de" target="_blank">Rainer@krugs.de</a><br>
<br>Skype:      RMkrug<br><br>
</blockquote></div><br></div></div></div></div>