@@ -4078,7 +4078,7 @@ struct GDALNoDataValues
4078
4078
bGotFloat16NoDataValue(false ), hfNoDataValue(GFloat16(0 .0f ))
4079
4079
{
4080
4080
dfNoDataValue = poRasterBand->GetNoDataValue (&bGotNoDataValue);
4081
- bGotNoDataValue = bGotNoDataValue && !CPLIsNan (dfNoDataValue);
4081
+ bGotNoDataValue = bGotNoDataValue && !std::isnan (dfNoDataValue);
4082
4082
4083
4083
ComputeFloatNoDataValue (eDataType, dfNoDataValue, bGotNoDataValue,
4084
4084
fNoDataValue , bGotFloatNoDataValue);
@@ -4322,9 +4322,10 @@ CPLErr GDALRasterBand::GetHistogram(double dfMin, double dfMax, int nBuckets,
4322
4322
break ;
4323
4323
case GDT_Float16:
4324
4324
{
4325
+ using namespace std ;
4325
4326
const GFloat16 hfValue =
4326
4327
static_cast <GFloat16 *>(pData)[iOffset];
4327
- if (CPLIsNan (hfValue) ||
4328
+ if (isnan (hfValue) ||
4328
4329
(sNoDataValues .bGotFloat16NoDataValue &&
4329
4330
ARE_REAL_EQUAL (hfValue,
4330
4331
sNoDataValues .hfNoDataValue )))
@@ -4336,7 +4337,7 @@ CPLErr GDALRasterBand::GetHistogram(double dfMin, double dfMax, int nBuckets,
4336
4337
{
4337
4338
const float fValue =
4338
4339
static_cast <float *>(pData)[iOffset];
4339
- if (CPLIsNan (fValue ) ||
4340
+ if (std::isnan (fValue ) ||
4340
4341
(sNoDataValues .bGotFloatNoDataValue &&
4341
4342
ARE_REAL_EQUAL (fValue ,
4342
4343
sNoDataValues .fNoDataValue )))
@@ -4377,7 +4378,7 @@ CPLErr GDALRasterBand::GetHistogram(double dfMin, double dfMax, int nBuckets,
4377
4378
static_cast <GFloat16 *>(pData)[iOffset * 2 ];
4378
4379
const double dfImag =
4379
4380
static_cast <GFloat16 *>(pData)[iOffset * 2 + 1 ];
4380
- if (CPLIsNan (dfReal) || CPLIsNan (dfImag))
4381
+ if (std::isnan (dfReal) || std::isnan (dfImag))
4381
4382
continue ;
4382
4383
dfValue = sqrt (dfReal * dfReal + dfImag * dfImag);
4383
4384
break ;
@@ -4593,9 +4594,10 @@ CPLErr GDALRasterBand::GetHistogram(double dfMin, double dfMax, int nBuckets,
4593
4594
break ;
4594
4595
case GDT_Float16:
4595
4596
{
4597
+ using namespace std ;
4596
4598
const GFloat16 hfValue =
4597
4599
static_cast <GFloat16 *>(pData)[iOffset];
4598
- if (CPLIsNan (hfValue) ||
4600
+ if (isnan (hfValue) ||
4599
4601
(sNoDataValues .bGotFloat16NoDataValue &&
4600
4602
ARE_REAL_EQUAL (hfValue,
4601
4603
sNoDataValues .hfNoDataValue )))
@@ -4607,7 +4609,7 @@ CPLErr GDALRasterBand::GetHistogram(double dfMin, double dfMax, int nBuckets,
4607
4609
{
4608
4610
const float fValue =
4609
4611
static_cast <float *>(pData)[iOffset];
4610
- if (CPLIsNan (fValue ) ||
4612
+ if (std::isnan (fValue ) ||
4611
4613
(sNoDataValues .bGotFloatNoDataValue &&
4612
4614
ARE_REAL_EQUAL (fValue ,
4613
4615
sNoDataValues .fNoDataValue )))
@@ -4644,7 +4646,7 @@ CPLErr GDALRasterBand::GetHistogram(double dfMin, double dfMax, int nBuckets,
4644
4646
static_cast <GFloat16 *>(pData)[iOffset * 2 ];
4645
4647
double dfImag =
4646
4648
static_cast <GFloat16 *>(pData)[iOffset * 2 + 1 ];
4647
- if (CPLIsNan (dfReal) || CPLIsNan (dfImag))
4649
+ if (std::isnan (dfReal) || std::isnan (dfImag))
4648
4650
continue ;
4649
4651
dfValue = sqrt (dfReal * dfReal + dfImag * dfImag);
4650
4652
break ;
@@ -6306,9 +6308,10 @@ static inline double GetPixelValue(GDALDataType eDataType, bool bSignedByte,
6306
6308
break ;
6307
6309
case GDT_Float16:
6308
6310
{
6311
+ using namespace std ;
6309
6312
const GFloat16 hfValue =
6310
6313
static_cast <const GFloat16 *>(pData)[iOffset];
6311
- if (CPLIsNan (hfValue) ||
6314
+ if (isnan (hfValue) ||
6312
6315
(sNoDataValues .bGotFloat16NoDataValue &&
6313
6316
ARE_REAL_EQUAL (hfValue, sNoDataValues .hfNoDataValue )))
6314
6317
{
@@ -6321,7 +6324,7 @@ static inline double GetPixelValue(GDALDataType eDataType, bool bSignedByte,
6321
6324
case GDT_Float32:
6322
6325
{
6323
6326
const float fValue = static_cast <const float *>(pData)[iOffset];
6324
- if (CPLIsNan (fValue ) ||
6327
+ if (std::isnan (fValue ) ||
6325
6328
(sNoDataValues .bGotFloatNoDataValue &&
6326
6329
ARE_REAL_EQUAL (fValue , sNoDataValues .fNoDataValue )))
6327
6330
{
@@ -6347,7 +6350,7 @@ static inline double GetPixelValue(GDALDataType eDataType, bool bSignedByte,
6347
6350
break ;
6348
6351
case GDT_CFloat16:
6349
6352
dfValue = static_cast <const GFloat16 *>(pData)[iOffset * 2 ];
6350
- if (isnan (dfValue))
6353
+ if (std:: isnan (dfValue))
6351
6354
{
6352
6355
bValid = false ;
6353
6356
return 0.0 ;
0 commit comments