Skip to content

Commit

Permalink
Fix floating point trunation in mod function (closes OSGeogh-3)
Browse files Browse the repository at this point in the history
  • Loading branch information
avalentino committed Feb 1, 2016
1 parent 4668088 commit ac7f70a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pixelfunctions.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ CPLErr ModulePixelFunc(void **papoSources, int nSources, void *pData,
for( iCol = 0; iCol < nXSize; ++iCol, ++ii ) {

/* Source raster pixels may be obtained with SRCVAL macro */
dfPixVal = abs(SRCVAL(papoSources[0], eSrcType, ii));
dfPixVal = fabs(SRCVAL(papoSources[0], eSrcType, ii));

GDALCopyWords(&dfPixVal, GDT_Float64, 0,
((GByte *)pData) + nLineSpace * iLine +
Expand Down Expand Up @@ -725,7 +725,7 @@ CPLErr Log10PixelFunc(void **papoSources, int nSources, void *pData,

/* Source raster pixels may be obtained with SRCVAL macro */
dfPixVal = SRCVAL(papoSources[0], eSrcType, ii);
dfPixVal = log10( abs( dfPixVal ) );
dfPixVal = log10( fabs( dfPixVal ) );

GDALCopyWords(&dfPixVal, GDT_Float64, 0,
((GByte *)pData) + nLineSpace * iLine +
Expand Down

0 comments on commit ac7f70a

Please sign in to comment.