Paulo van Breugel wrote:
In case you haven't seen it, Markus Metz has implemented in trunk r56313
http://trac.osgeo.org/grass/changeset/56313 the option to have the
same raster type as output of round() as the input type, see ticket 1976
(http://trac.osgeo.org/grass/ticket/).
I've seen
Markus Metz wrote:
Happy to see this exchange of ideas. It would be great if this could be
implemented. Do you think it is useful I make a feature request on the bug
tracker (with link to this email thread) so the idea doesn't get lost?
Instead of
r.mapcalc A = if(B==0,
Rainer M. Krug wrote:
Sounds like a sensible approach without adding to many new
functions. But I would actually split the two, i.e. have two more
arguments, where one specifies the type,
and the other one the number of decimals to round to, i.e.
round(x, 0, I) would be the
On 05/20/2013 01:46 PM, Glynn Clements wrote:
Markus Metz wrote:
Happy to see this exchange of ideas. It would be great if this could be
implemented. Do you think it is useful I make a feature request on the bug
tracker (with link to this email thread) so the idea doesn't get lost?
Instead of
Rainer M. Krug wrote:
One option is to modify round() to take a second argument (defaulting
to 1), and have it return the first argument rounded to the nearest
multiple of the second. The return type would be that of the second
argument, i.e. round(x,1) rounds to the nearest integer and
Hi Glynn and Rainer
Happy to see this exchange of ideas. It would be great if this could be
implemented. Do you think it is useful I make a feature request on the bug
tracker (with link to this email thread) so the idea doesn't get lost?
On Fri, May 17, 2013 at 4:38 PM, Glynn Clements
Glynn Clements gl...@gclements.plus.com writes:
Rainer M. Krug wrote:
One option is to modify round() to take a second argument (defaulting
to 1), and have it return the first argument rounded to the nearest
multiple of the second. The return type would be that of the second
argument,
Paulo van Breugel p.vanbreu...@gmail.com writes:
Hi Glynn and Rainer
Happy to see this exchange of ideas. It would be great if this could be
implemented. Do you think it is useful I make a feature request on the bug
tracker (with link to this email thread) so the idea doesn't get lost?
Yes
On Fri, May 17, 2013 at 5:13 PM, Paulo van Breugel
p.vanbreu...@gmail.com wrote:
Hi Glynn and Rainer
Happy to see this exchange of ideas. It would be great if this could be
implemented. Do you think it is useful I make a feature request on the bug
tracker (with link to this email thread) so
Thanks Markus,
That is certainly a good suggestion. The problem however remains I think
with the part
round(C / 0.0001)
If C/0.0001 2^31, i.e., larger then the maximum possible integer,
there will be an error.
The white spaces, is that for another reason then being clearer?
Cheers,
I just looked at the round function in xround.c, and it does not look to
complicated to modify round() to obtain have three more functions, aligned to
the
R functions:
From the R help:
,
| ‘ceiling’ takes a single numeric argument ‘x’ and returns a
| numeric vector containing the
Thanks for that Rainer. I have no expertise in C too, but let me file a
feature / enhancement request, perhaps somebody can pick this up.
Cheers,
Paulo
On 05/16/2013 09:38 AM, Rainer M. Krug wrote:
I just looked at the round function in xround.c, and it does not look to
complicated to
Rainer M Krug wrote:
The round() function always returns an integer, regardless of its
argument types. Integers are always 32-bit, so the result is limited
to the range +/- 2147483647 (2^31-1).
True - but is there an equivalent function to round numbers outside the
integer range?
No.
Glynn Clements gl...@gclements.plus.com writes:
Rainer M Krug wrote:
The round() function always returns an integer, regardless of its
argument types. Integers are always 32-bit, so the result is limited
to the range +/- 2147483647 (2^31-1).
True - but is there an equivalent function
Hi,
I am having trouble with the following computation, which gives me an
overflow warning (WARNING: Overflow occured in the calculation).
r.mapcalc A = if(B==0, (round(C/0.0001)-1175699902)/(300797-1175699902) *100.0,
1) --overwrite
whereby C is a map with values between 1 and 31000.
Paulo van Breugel p.vanbreu...@gmail.com writes:
Hi,
I am having trouble with the following computation, which gives me an
overflow warning (WARNING: Overflow occured in the
calculation).
oerflow usually means that the result of a calculation does not fit into
the variable type selected,
Hi Rainer,
Thanks a lot for your reply. The problem is indeed that the result of
the calculation does not fit into the variable and your answer made me
realize I had to take a closer look at what happens inside the formula.
As it turns out, the problem lies in the following part of the
Paulo van Breugel wrote:
I am having trouble with the following computation, which gives me an
overflow warning (WARNING: Overflow occured in the calculation).
r.mapcalc A = if(B==0, (round(C/0.0001)-1175699902)/(300797-1175699902)
*100.0, 1) --overwrite
whereby C is a map with
On Wednesday, May 15, 2013, Glynn Clements wrote:
Paulo van Breugel wrote:
I am having trouble with the following computation, which gives me an
overflow warning (WARNING: Overflow occured in the calculation).
r.mapcalc A = if(B==0,
(round(C/0.0001)-1175699902)/(300797-1175699902)
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?
Paulo
On Wed,
20 matches
Mail list logo