Pelles C forum

C language => Expert questions => Topic started by: Alessio on January 17, 2008, 09:50:13 pm

Title: using NAN
Post by: Alessio on January 17, 2008, 09:50:13 pm

I've a huge dataset with nan values that are represented by value -9999.
I want to set those values to NAN (math.h) because I don't want
to put a check on every mathematical operation like this:

-9999 * 2= -19998 ERROR!

NAN * 2 = nan OK!

When I set a variable to NAN this compiler warnings appears: "#2046: Expression with no effect removed."
There's a workaround for this ?

Title: Re: using NAN
Post by: Pelle on January 17, 2008, 10:23:48 pm
This is a side effect of the current definition of NAN (in math.h) in v4.50; already taken care of in version 5.0. The end result should be OK, but you get this silly warning - either use warning level 1, or turn off this specific warning (#2046) for now...