The 32 bit int seems to be overflowing - A signed 32 bit int should have values -2.147483e+09 to 2.147483e+09, and you were calculating 2.452453e+09. This might work better: r.mapcalc 'test3=(w.acc.p1a/(s.acc.p1a/1000))'