cosmopolitan/libc/math/__signbit.c

14 lines
151 B
C

#include "libc/math/libm.h"
// FIXME: macro in math.h
int __signbit(double x)
{
union {
double d;
uint64_t i;
} y = { x };
return y.i>>63;
}