logo       

Re: signbit ISO C99 macro: msg#00004

Subject: Re: signbit ISO C99 macro
It's easy if it's easy to treat doubles as uint64_t's.  Like, I think
signbit() might be something like

#define signbit(d)      (*((uint64_t *)&(d)) & UINT64_C(0x8000000000000000))

or maybe

#define signbit(d)      (*((uint64_t *)&(d)) >> 63)

However, that assumes that d is an IEEE double (and there is a
possibly-incorrect assumption about byte order).  I don't know how to
implement a macro that will take any real-floating type.

  Bill

To Unsubscribe: send mail to majordomo@xxxxxxxxxxx
with "unsubscribe freebsd-standards" in the body of the message



<Prev in Thread] Current Thread [Next in Thread>