I have this macro definition in one file (we'll call it file1.c):
#define VAL_NOT_SET -9999.9
In another file, I include file1, then initialize a different variable to VAL_NOT_SET
:
decimal value;
value = VAL_NOT_SET;
Later on, I try to compare the two values:
if(value == VAL_NOT_SET){
...
}
But that if statement fails. When I print out the contents of value
and VAL_NOT_SET
, I get:
value == -9999.900000
VAL_NOT_SET == 759.867067
However, if I set my macro to just -9999
, not -9999.9
, there is no problem, and VAL_NOT_SET
keeps its value.
Also, this is code that I am trying to transition from an AIX machine to Linux, and there was no problem with any of this on AIX. Does anyone have any idea why the macro loses its value, but only when it's a float
?