c - Macro Definition Changes Values? -
c - Macro Definition Changes Values? -
i have macro definition in 1 file (we'll phone call file1.c):
#define val_not_set -9999.9 in file, include file1, initialize different variable val_not_set:
decimal value; value = val_not_set; later on, seek compare 2 values:
if(value == val_not_set){ ... } but if statement fails. when print out contents of value , val_not_set, get:
value == -9999.900000 val_not_set == 759.867067 however, if set macro -9999, not -9999.9, there no problem, , val_not_set keeps value.
also, code trying transition aix machine linux, , there no problem of on aix. have thought why macro loses value, when it's float?
c linux macros definitions
Comments
Post a Comment