[gdal-dev] Reading a double from file

Andrew C Aitchison andrew at aitchison.me.uk
Tue Jun 16 01:07:57 PDT 2020


Does gdal have a standard, endian-independent,
way to read floating point values from file ?
Specifically IEEE-754 little-endian 64bit values.

So far my driver has used a union to "cast" 8 bytes to a double,
but I now discover that, whilst this is valid C, it is not valid C++.
I am looking for a portable way to read such values from file
into a C++ double. This cannot be the first gdal driver to need to do this.

Thanks,

-- 
Andrew C. Aitchison					Kendal, UK
 			andrew at aitchison.me.uk


More information about the gdal-dev mailing list