[gdal-dev] Precission problem with atof

Adam Nowacki nowak at xpam.de
Wed Jul 22 19:17:25 EDT 2009


Jorge Arévalo wrote:
>  fPixelSizeX = atof(PQgetvalue(hPGresult, 0, 2));
> 
> I get 0.899999976158142 instead of 0.9.

0.899999976158142... is the value closest to 0.9 that a single precision 
float variable can store.
Using 'double' should give 0.90000000000000002220...



More information about the gdal-dev mailing list