[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Old patches from Red Hat
From: |
Daniel J Sebald |
Subject: |
Re: Old patches from Red Hat |
Date: |
Thu, 28 Apr 2005 17:37:14 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 |
John W. Eaton wrote:
On 28-Apr-2005, Daniel J Sebald wrote:
| Can some of these definitions and routines be replaced with
| something from the header file "ieee754.h"? In there are a variety
| of helper routines and structures for accessing the sign bit.
Is that header file defined by any standard?
Good question. I've searched the web. My guess is that it might be part of the
GNU C library definition (not actually in the library though because it is just
definitions). As for machines that don't use IEEE-754 floating point, I don't
know how those are handled.
On my system, /usr/include/ieee754.h does not include any declarations
for functions or any macros that appear to be related to accessing the
sign bit. All I see are some declarations of some structures for
defining the format of IEEE floating point values. But maybe I'm
missing something.
That does appear to be it. Perhaps the designers felt a bit field pointer was
simple enough. So, lo_ieee_signbit(x) could be defined as casting the address
of x to the ieee754_float type and using (pointer)->negative. I.e.,
#define lo_ieee_signbit(x) (((ieee754_float *)&x).ieee->negative)
That gets rid of all the
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#define _UNSET_GNU_SOURCE 1
#endif
contortions. However, the issue of portability to non-GNU compilers is still
there.
Dan