C/math.h/signbit
int signbit(fpval): Returns nonzero if fpval is negative (that is, its sign bit is set)
#include <stdio.h>
#include <math.h>
int main(void)
{
printf("signbit(-1.0) %d\n", signbit(-1.0));
printf("signbit(1.0) %d\n", signbit(1.0));
printf("signbit(0.0) %d\n", signbit(0.0));
return 0;
}
/*
signbit(-1.0) 512
signbit(1.0) 0
signbit(0.0) 0
*/