re: r.mapcalc question

I am trying to extract out certain ranges of values from one of my map
layers and apply a formula to it to produce a new one. From my
understanding of r.infer and r.mapcalc, it would seem that I need a
combination of both modules, so that I could essentially come up with the
following

               IFMAP temperature x-y
               THEN r.mapcalc newtemp='(temperature*2)-50'

It is possible to use the following r.mapcalc command:

/* temp == temperature */

r.mapcalc newtemp = 'if(temp >= x && temp <= y , temp * 2 - 50)'

note that if temp < x || temp > y, then r.mapcalc will give it a value of 0.
If you want it to be a different value (i.e., if outside range, then -9999):

r.mapcalc newtemp = 'if(temp >= x && temp <= y , temp * 2 - 50 , -9999)'