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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -