This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FLT_ROUNDS not always 1?


On Mon, 25 Feb 2002, Richard Henderson wrote:

> > Or is it just that systems that implement fesetround need to have
> > their own config/float-foo.h that defines FLT_ROUNDS in a non-constant
> > way, and no one has done this correctly yet?
> 
> Correct.
> 
> Actually, it would be trivial to add one that uses fegetround,
> which will work everywhere that actually has fesetround.

fegetround is in the application namespace, for C90.

To avoid a proliferation of float.h headers, I think we could use two
predefined preprocessor macros, __FLT_ROUNDS (which is the value of
FLT_ROUNDS, e.g. a function call) and __FLT_ROUNDS_DECL (which declares
any functions - in the implementation namespace - called by __FLT_ROUNDS -
unless they are __builtin functions).  Appropriate definitions might allow
us to get rid of some of the cases where we currently use the system
float.h (which doesn't support C99) rather than ours.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]