Commit d56d90dd authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

use DBL_IS_EQUAL to compare floating point

parent 01dabc79
......@@ -5,6 +5,7 @@
* set alias gradsdes to gradsdes2
* rename gradsdes to gradsdes1
* add option -z szip to compress GRIB records with SZIP
* use DBL_IS_EQUAL to compare floating point
* remapbil, remapbic: improvement and speedup for regional lonlat grids
* Seltime: print warning message if parameter not found
* pstreamDefVlist: unpack netCDF data if datatype = FLT64
......
......@@ -36,7 +36,7 @@ case "${HOSTNAME}" in
./configure --prefix=$HOME/local --exec_prefix=$HOME/local/LINUX \
--with-netcdf=/client \
CPPFLAGS="-DHAVE_LIBSZ -I$HOME/local/LINUX/include" LIBS=$HOME/local/LINUX/lib/libsz.a \
CC=gcc CFLAGS="-g -D_REENTRANT -O2 -Wall "
CC=gcc CFLAGS="-g -D_REENTRANT -O2 -Wall -W -Wfloat-equal"
;;
regio01)
./configure --prefix=$HOME/local --exec_prefix=$HOME/local/LINUX0 \
......
......@@ -309,7 +309,7 @@ void *Info(void *argument)
fprintf(stdout, "%7d %7d :", gridsize, nmiss);
if ( gridInqType(gridID) == GRID_SPECTRAL ||
if ( /* gridInqType(gridID) == GRID_SPECTRAL || */
(gridsize == 1 && nmiss == 0) )
{
fprintf(stdout, " %#12.5g\n", array[0]);
......
......@@ -171,7 +171,7 @@ void *Seltime(void *argument)
status = sscanf(operatorArgv()[i], "%d-%d-%dT%d:%d", &year, &month, &day, &hour, &minute);
/* fprintf(stderr, "status = %d\n", status); */
fval = hour*100 + minute;
if ( fval ) fval /= 10000;
if ( fabs(fval) > 0 ) fval /= 10000;
fval += year*10000 + month*100 + day;
listSetFlt(flist, i, fval);
}
......
......@@ -187,7 +187,7 @@ void *Wind(void *argument)
vlistChangeVarGrid(vlistID2, varID2, gridID2);
vlistDefVarCode(vlistID2, varID1, 155);
vlistDefVarCode(vlistID2, varID2, 138);
/* define varname aso. !!! */
/* define varname also !!! */
nlon = gridInqXsize(gridID1);
nlat = gridInqYsize(gridID1);
......@@ -233,7 +233,7 @@ void *Wind(void *argument)
vlistChangeVarGrid(vlistID2, varID2, gridID2);
vlistDefVarCode(vlistID2, varID1, 131);
vlistDefVarCode(vlistID2, varID2, 132);
/* define varname aso. !!! */
/* define varname also !!! */
ntr = gridInqTrunc(gridID1);
nlon = gridInqXsize(gridID2);
......
......@@ -40,7 +40,7 @@ void hsv_to_rgb (int rgb[], double h, double s, double v)
int i;
double f, p, q, t, rr = 0, gg = 0, bb = 0;
if (s == 0.0)
if ( !(fabs(s) > 0) )
rgb[0] = rgb[1] = rgb[2] = (int) floor (255.999 * v);
else {
while (h >= 360.0) h -= 360.0;
......@@ -307,7 +307,7 @@ int cptRead(FILE *fp, CPT *cpt)
}
dz = cpt->lut[n].z_high - cpt->lut[n].z_low;
if (dz == 0.0) {
if ( !(fabs(dz) > 0) ) {
fprintf (stderr, "%s: Z-slice with dz = 0\n", func);
return (READERR);
}
......@@ -343,7 +343,7 @@ int cptRead(FILE *fp, CPT *cpt)
cpt->lut = (LUT *) realloc((void *)cpt->lut, (size_t)n*sizeof (LUT));
ncolors = n;
for (i = annot = 0, gap = FALSE; i < ncolors - 1; i++) {
if (cpt->lut[i].z_high != cpt->lut[i+1].z_low) gap = TRUE;
if ( fabs(cpt->lut[i].z_high - cpt->lut[i+1].z_low) > 0 ) gap = TRUE;
annot += cpt->lut[i].annot;
}
......
......@@ -280,7 +280,7 @@ static MODULES Modules[] =
{ Math, MathHelp, MathOperators, 1, 1 },
{ Merge, MergeHelp, MergeOperators, -1, 1 },
{ Mergegrid, NULL, MergegridOperators, 2, 1 },
{ Mergetime, NULL, MergetimeOperators, -1, 1 },
{ Mergetime, MergeHelp, MergetimeOperators, -1, 1 },
{ Merstat, MerstatHelp, MerstatOperators, 1, 1 },
{ Ninfo, NinfoHelp, NinfoOperators, 1, 0 },
{ Nmltest, NULL, NmltestOperators, 0, 0 },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment