Determine whether a floating-point number is negative
#include <math.h> #define signbit( x ) ...
The signbit() macro determines whether the given floating-point number is negative. The sign bit is set for negative numbers, including negative NaN, negative zero, and negative infinity.
Nonzero if the given number is negative.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |