[gdal-dev] GDALSetRasterNoDataValue and NaN

Mateusz Loskot mateusz at loskot.net
Tue Aug 21 04:14:39 PDT 2012


On 21 August 2012 12:01, Radim Blazek <radim.blazek at gmail.com> wrote:
> Hi,
> is it safe to use GDALSetRasterNoDataValue() with
> std::numeric_limits<double>::quiet_NaN()?

What kind of safety do you mean?

AFAICT, it does not sound sensible anyway.
Use of NaN would give unreliable results, by definition of NaN:

    double n1 = std::numeric_limits<double>::quiet_NaN();
    double n2 = std::numeric_limits<double>::quiet_NaN();
    assert(n1 != n2);

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list