<div dir="ltr">This is a rather interesting error, which is listed here (<a href="https://trac.osgeo.org/gdal/ticket/5478">https://trac.osgeo.org/gdal/ticket/5478</a>).  While getting the intermediate calculations of the raster band for A and B, I noticed the following - <div><br></div><div>For --calc="A*20+B", the raster formed as the result of the addition of A*20 and B is not equal to A*20 + B. </div><div><br></div><div><div>For --calc="A*20.0+B", the raster formed as the result of the addition of A*20.0 and B is, in fact, equal to A*20 + B. </div></div><div><br></div><div>Logically, these should have the same value as there is no difference between 20.0 and 20. However, as it is pointed out in the thread, running gdalinfo -stats on them yields - </div><div><br></div><div>For --calc="A*20+B", the raster formed is a valid raster. </div><div><br></div><div>For --calc="A*20.0+B", the raster formed is invalid!<br></div><div><br></div><div>Hence, even though the intermediate calculation on the second --calc value is correct, there is no valid output raster formed. Is it because the value A*20 + B would have overshot the boundary values for 8-bit channel? Any thoughts? </div><div><br></div><div>Regards,</div><div><br></div><div>Avyav </div></div>