From owner-freebsd-standards Sat Feb 8 16:33:54 2003 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31CA937B401 for ; Sat, 8 Feb 2003 16:33:53 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95E1143F85 for ; Sat, 8 Feb 2003 16:33:52 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h190XpYP020930; Sat, 8 Feb 2003 16:33:51 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h190XoZj020929; Sat, 8 Feb 2003 16:33:50 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sat, 8 Feb 2003 16:33:50 -0800 From: David Schultz To: Lukas Ertl Cc: standards@FreeBSD.ORG Subject: Re: C99 floating point macros Message-ID: <20030209003350.GA20683@HAL9000.homeunix.com> Mail-Followup-To: Lukas Ertl , standards@FreeBSD.ORG References: <20030207194848.N353@leelou.in.tern> <20030208112619.GA15718@HAL9000.homeunix.com> <20030208130529.C355@leelou.in.tern> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030208130529.C355@leelou.in.tern> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Lukas Ertl : > On Sat, 8 Feb 2003, David Schultz wrote: > > > Thus spake Lukas Ertl : > > > 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