My program during calculation can generate nan or -nan values.
I check if the values are nan/-nan using isnan method.
I also have to distinguish if the nan value is positive or negative (nan or -nan). How can I do this?
Added:I need crossplatform solution for WIN and for Unix/Linux
Try
signbitfrom<math.h>:It’s apparently part of C99 and POSIX.1-2001, but you could write a macro/function yourself if you don’t want to use/conform to either of the two.