Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Feb 2003 16:33:50 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        Lukas Ertl <l.ertl@univie.ac.at>
Cc:        standards@FreeBSD.ORG
Subject:   Re: C99 floating point macros
Message-ID:  <20030209003350.GA20683@HAL9000.homeunix.com>
In-Reply-To: <20030208130529.C355@leelou.in.tern>
References:  <20030207194848.N353@leelou.in.tern> <20030208112619.GA15718@HAL9000.homeunix.com> <20030208130529.C355@leelou.in.tern>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Lukas Ertl <l.ertl@univie.ac.at>:
> On Sat, 8 Feb 2003, David Schultz wrote:
> 
> > Thus spake Lukas Ertl <l.ertl@univie.ac.at>:
> > > I hope I don't sound too stupid but I'd like to contribute something to
> > > FreeBSD. Looking through the C99 status board I found noone has started
> > > working on implementation of the C99 macros isgreater, isless etc. If I
> > > read the standard correctly it doesn't seem to be so hard to implement
> > > them, but I'm having some questions:
> > >
> > > *) Where should I put additional source files / change existing ones to
> > >    confirm to the FreeBSD source tree?
> >
> > If your changes are MI macros, then they go in math.h.  Otherwise,
> > look at the forthcoming machine/_math.h.
> 
> Ok, please review the following patch. I hope I didn't take it too easy.

Hmm...why not just use some macros, like this?

#define	isgreater(x, y)		(!isunordered((x), (y)) && (x) > (y))
#define	isgreaterequal(x, y)	(!isunordered((x), (y)) && (x) >= (y))
#define	isless(x, y)		(!isunordered((x), (y)) && (x) < (y))
#define	islessequal(x, y)	(!isunordered((x), (y)) && (x) <= (y))
#define	islessgreater(x, y)	(!isunordered((x), (y)) && \
					((x) > (y) || (y) > (x)))
#define	isunordered(x, y)	(isnan(x) || isnan(y))

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030209003350.GA20683>