From owner-freebsd-standards Sun Feb 2 14:26:37 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 F3B5E37B401 for ; Sun, 2 Feb 2003 14:26:36 -0800 (PST) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A0AC43E4A for ; Sun, 2 Feb 2003 14:26:36 -0800 (PST) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id D89E8536E; Sun, 2 Feb 2003 23:26:33 +0100 (CET) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: standards@freebsd.org Subject: stdint.h in -STABLE From: Dag-Erling Smorgrav Date: Sun, 02 Feb 2003 23:26:33 +0100 Message-ID: Lines: 6 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386--freebsd) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Please MFC stdint.h to -STABLE ASAP. I need it for OpenSSH, which is still at 3.4p1 (+ several known bugs in the FreeBSD patches) in 4.x. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Mon Feb 3 3:21:33 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 5173D37B401 for ; Mon, 3 Feb 2003 03:21:32 -0800 (PST) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55B6843FA7 for ; Mon, 3 Feb 2003 03:21:31 -0800 (PST) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 9894C5371; Mon, 3 Feb 2003 12:21:29 +0100 (CET) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: standards@freebsd.org Subject: Re: stdint.h in -STABLE References: From: Dag-Erling Smorgrav Date: Mon, 03 Feb 2003 12:21:28 +0100 In-Reply-To: (Dag-Erling Smorgrav's message of "Sun, 02 Feb 2003 23:26:33 +0100") Message-ID: Lines: 10 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386--freebsd) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Dag-Erling Smorgrav writes: > Please MFC stdint.h to -STABLE ASAP. I need it for OpenSSH, which is > still at 3.4p1 (+ several known bugs in the FreeBSD patches) in 4.x. Never mind, I bungled the configure step. OpenSSH will be fine without stdint.h. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Mon Feb 3 5: 6:14 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 050B537B405 for ; Mon, 3 Feb 2003 05:06:14 -0800 (PST) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81E6843F79 for ; Mon, 3 Feb 2003 05:06:13 -0800 (PST) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 4FF235371; Mon, 3 Feb 2003 14:06:10 +0100 (CET) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: standards@freebsd.org Subject: Task list errata From: Dag-Erling Smorgrav Date: Mon, 03 Feb 2003 14:06:10 +0100 Message-ID: Lines: 7 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386--freebsd) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 In the "functions and system calls" section, the "Implement strtof(), strtold()" item is listed twice - once attributed to Alexey Zelkin and half-finished, and once unattributed and 0% done. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Mon Feb 3 9: 5:58 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 832A937B406; Mon, 3 Feb 2003 09:05:56 -0800 (PST) Received: from relay1.cris.net (relay1.cris.net [212.110.128.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06220440F8; Mon, 3 Feb 2003 09:05:02 -0800 (PST) (envelope-from phantom@phantom.cris.net) Received: from phantom.cris.net (root@phantom.cris.net [212.110.130.74]) by relay1.cris.net (8.12.6/8.12.6) with ESMTP id h13J8eQc050491; Mon, 3 Feb 2003 19:08:44 GMT Received: (from phantom@localhost) by phantom.cris.net (8.12.6/8.12.2) id h13HBPwB071439; Mon, 3 Feb 2003 19:11:25 +0200 (EET) (envelope-from phantom) Date: Mon, 3 Feb 2003 19:11:25 +0200 From: Alexey Zelkin To: mike@freebsd.org Cc: standards@freebsd.org Subject: Re: [des@ofug.org: Task list errata] Message-ID: <20030203191125.A71395@phantom.cris.net> References: <20030203135749.GB59765@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20030203135749.GB59765@sunbay.com>; from ru@FreeBSD.org on Mon, Feb 03, 2003 at 03:57:49PM +0200 X-Operating-System: FreeBSD 4.7-STABLE i386 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 Mike, Unfortunatelly my work was with AT&T strtod package was delayed because of real life issues, and I not sure that I'll be able to come back to this issue soon. Please release this item from myself. I'll dig thru backup of crashed machine to find patches to make *printf() support \' flag for floating-point numbers (I have had working one), but no more (yet). Sorry :-( On Mon, Feb 03, 2003 at 03:57:49PM +0200, Ruslan Ermilov wrote: > Delivered-To: ru@freebsd.org > Delivered-To: freebsd-standards@freebsd.org > To: standards@FreeBSD.ORG > Subject: Task list errata > From: Dag-Erling Smorgrav > Date: Mon, 03 Feb 2003 14:06:10 +0100 > > In the "functions and system calls" section, the "Implement strtof(), > strtold()" item is listed twice - once attributed to Alexey Zelkin and > half-finished, and once unattributed and 0% done. > > DES > -- > Dag-Erling Smorgrav - des@ofug.org > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-standards" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Feb 5 12:46:52 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 F33DD37B401 for ; Wed, 5 Feb 2003 12:46:45 -0800 (PST) Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29BA743E4A for ; Wed, 5 Feb 2003 12:46:45 -0800 (PST) (envelope-from ben@timing.com) Received: from piglet.timing.com (piglet.timing.com [206.168.13.178]) by Daffy.timing.com (8.11.3/8.11.3) with ESMTP id h15KkiH96847 for ; Wed, 5 Feb 2003 13:46:44 -0700 (MST) (envelope-from ben@timing.com) Received: from piglet.timing.com (localhost.timing.com [127.0.0.1]) by piglet.timing.com (8.12.6/8.12.6) with ESMTP id h15KkiXl020862 for ; Wed, 5 Feb 2003 13:46:44 -0700 (MST) (envelope-from ben@piglet.timing.com) Received: (from ben@localhost) by piglet.timing.com (8.12.6/8.12.6/Submit) id h15Kkibb020859; Wed, 5 Feb 2003 13:46:44 -0700 (MST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15937.30772.290602.974328@piglet.timing.com> Date: Wed, 5 Feb 2003 13:46:44 -0700 From: Ben Mesander To: freebsd-standards@freebsd.org Subject: proposed patch to math.h & lgamma(3) manpage X-Mailer: VM 7.00 under Emacs 21.2.95.2 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 Hi, A week or so ago I mentioned I was interested in doing a patch to resolve some issues with math.h & the lgamma(3) man page. In summary: - gamma_r, lgamma_r, gammaf_r, and lgammaf_r were protected by _REENTRANT in math.h; the consensus here was that __BSD_VISIBLE was correct instead. - gamma_r, lgamma_r, gammaf_r, and lgammaf_r had no documentation in the lgamma(3) manpage. Here is my proposed patch. Let me know what you think. Regards, Ben --- lib/msun/src/math.h.old Fri Jan 31 18:01:51 2003 +++ lib/msun/src/math.h Fri Jan 31 16:04:03 2003 @@ -202,10 +202,10 @@ * Reentrant version of gamma & lgamma; passes signgam back by reference * as the second argument; user must allocate space for signgam. */ -#ifdef _REENTRANT +#ifdef __BSD_VISIBLE double gamma_r(double, int *); double lgamma_r(double, int *); -#endif /* _REENTRANT */ +#endif /* __BSD_VISIBLE */ /* float versions of ANSI/POSIX functions */ float acosf(float); @@ -284,10 +284,10 @@ * signgam back by reference as the second argument; user must * allocate space for signgam. */ -#ifdef _REENTRANT +#ifdef __BSD_VISIBLE float gammaf_r(float, int *); float lgammaf_r(float, int *); -#endif /* _REENTRANT */ +#endif /* __BSD_VISIBLE */ #endif /* !_XOPEN_SOURCE */ #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ --- lib/msun/man/lgamma.3.old Fri Jan 31 18:02:26 2003 +++ lib/msun/man/lgamma.3 Fri Jan 31 15:57:27 2003 @@ -37,9 +37,13 @@ .Os .Sh NAME .Nm lgamma , +.Nm lgamma_r , .Nm lgammaf , +.Nm lgammaf_r , .Nm gamma , +.Nm gamma_r , .Nm gammaf , +.Nm gammaf_r , .Nm tgamma .Nd log gamma functions, gamma function .Sh LIBRARY @@ -51,12 +55,20 @@ .sp .Ft double .Fn lgamma "double x" +.Ft double +.Fn lgamma_r "double x, int *signgamp" .Ft float .Fn lgammaf "float x" +.Ft float +.Fn lgammaf_r "float x, int *signgamp" .Ft double .Fn gamma "double x" +.Ft double +.Fn gamma_r "double x, int *signgamp" .Ft float .Fn gammaf "float x" +.Ft float +.Fn gammaf_r "float x, int *signgamp" .Ft double .Fn tgamma "double x" .Sh DESCRIPTION @@ -78,13 +90,26 @@ .Fa signgam returns the sign of \(*G(x). .Pp -.Fn gamma +.Fn lgamma_r x signgamp and -.Fn gammaf -are deprecated aliases for -.Fn lgamma +.Fn lgammaf_r x signgamp +provide the same functionality as +.Fn lgamma x +and +.Fn lgammaf x +but the caller must provide an integer to store the sign of \(*G(x) +.Pp +.Fn gamma , +.Fn gammaf , +.Fn gamma_r , and +.Fn gammaf_r +are deprecated aliases for +.Fn lgamma , .Fn lgammaf , +.Fn lgamma_r , +and +.Fn lgammaf_r , respectively. .Fn tgamma x returns \(*G(x), with no effect on @@ -113,10 +138,14 @@ will lose up to 10 significant bits. .Sh RETURN VALUES .Fn gamma , +.Fn gamma_r, .Fn gammaf , +.Fn gammaf_r , .Fn lgamma , +.Fn lgamma_r , +.Fn lgammaf, and -.Fn lgammaf +.Fn lgammaf_r return appropriate values unless an argument is out of range. Overflow will occur for sufficiently large positive values, and non-positive integers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Feb 5 13:14: 8 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 34CDD37B671 for ; Wed, 5 Feb 2003 13:13:46 -0800 (PST) Received: from yahoo.com.tw (135.0.30.61.isp.tfn.net.tw [61.30.0.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8294943F79 for ; Wed, 5 Feb 2003 13:13:44 -0800 (PST) (envelope-from conychangkimo@yahoo.com.tw) From: jerry@FreeBSD.ORG To: µ¹»{¯u¥´«÷ªºªB¤Í@FreeBSD.ORG Subject: ¸gÀ礧¯«ªº¯µ±K Reply-To: conychangkimo@yahoo.com.tw Date: 06 Feb 2003 05:33:42 +0800 Organization: Foobar Inc. X-Mailer: Gammadyne Mailer x-delete-me: 1 (this tells Gammadyne's server to delete the message) MIME-Version: 1.0 Content-Type: text/html Content-Transfer-Encoding: 8bit Message-Id: <20030205211344.8294943F79@mx1.FreeBSD.org> 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 ¦L¶r¾÷

·s¦~§ª«°e±z¤@¥x¦L¶r¾÷ ...

To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Feb 5 14:30: 6 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 462BA37B401 for ; Wed, 5 Feb 2003 14:30:05 -0800 (PST) Received: from yahoo.com.tw (135.0.30.61.isp.tfn.net.tw [61.30.0.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0726043FCB for ; Wed, 5 Feb 2003 14:30:01 -0800 (PST) (envelope-from conychangkimo@yahoo.com.tw) From: jerry@FreeBSD.ORG To: µ¹»{¯u¥´«÷ªºªB¤Í@FreeBSD.ORG Subject: ¸gÀ礧¯«ªº¯µ±K Reply-To: conychangkimo@yahoo.com.tw Date: 06 Feb 2003 06:50:00 +0800 Organization: Foobar Inc. X-Mailer: Gammadyne Mailer x-delete-me: 1 (this tells Gammadyne's server to delete the message) MIME-Version: 1.0 Content-Type: text/html Content-Transfer-Encoding: 8bit Message-Id: <20030205223002.0726043FCB@mx1.FreeBSD.org> 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 ¦L¶r¾÷

·s¦~§ª«°e±z¤@¥x¦L¶r¾÷ ...

To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Feb 6 6: 6:55 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 2F98737B401 for ; Thu, 6 Feb 2003 06:06:54 -0800 (PST) Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 294A943FAF for ; Thu, 6 Feb 2003 06:06:53 -0800 (PST) (envelope-from hiten@angelica.unixdaemons.com) Received: from angelica.unixdaemons.com (hiten@localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.7/8.12.1) with ESMTP id h16E6iOm044171; Thu, 6 Feb 2003 09:06:44 -0500 (EST) Received: (from hiten@localhost) by angelica.unixdaemons.com (8.12.7/8.12.1/Submit) id h16E6iSL044170; Thu, 6 Feb 2003 09:06:44 -0500 (EST) (envelope-from hiten) Date: Thu, 6 Feb 2003 09:06:44 -0500 From: Hiten Pandya To: Craig Rodrigues Cc: freebsd-standards@FreeBSD.ORG Subject: Re: Open POSIX Test Suite project Message-ID: <20030206140644.GA42617@unixdaemons.com> References: <20021216151618.A13539@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021216151618.A13539@attbi.com> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD i386 X-Public-Key: http://www.pittgoth.com/~hiten/pubkey.asc X-URL: http://www.unixdaemons.com/~hiten X-PGP: http://pgp.mit.edu:11371/pks/lookup?search=Hiten+Pandya&op=index 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 On Mon, Dec 16, 2002 at 03:16:18PM -0500, Craig Rodrigues wrote the words in effect of: > Hi, > > Some of you on this list may be interested in the > Open POSIX Test Suite project: > > http://posixtest.sf.net > > The project is aiming to testing conformance and > performance of functions listed in IEEE Std 1003.1-2001. > > Version 0.1.0 did not work on FreeBSD-CURRENT, but > I submitted a patch which fixed this problem, and > hopefully it will be committed to their CVS tree soon. > > Interestingly enough, all the main people who work > on this project are from Intel. I posted this information to the -standards group before, but no one was excited. ;-) Unfortunately, the test suite does not run "out-of-the-box" on FreeBSD, and after muddling around, I could get some results, which are worth looking at (again): http://www.unixdaemons.com/~hiten/posix I have got the following information stored in directory: - Tests against libc - Tests against libc_r - Tests against libpthread Hope the stuff is helpful. This was done when I was working and interested with the KSE lib. stuff. Cheers. P.S. Sorry for the late reply. :-) -- Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org) http://www.unixdaemons.com/~hiten/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Feb 6 6:27:11 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 DFECD37B401 for ; Thu, 6 Feb 2003 06:27:10 -0800 (PST) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [24.61.43.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CCB443F75 for ; Thu, 6 Feb 2003 06:27:10 -0800 (PST) (envelope-from rodrigc@attbi.com) Received: from h00609772adf0.ne.client2.attbi.com (localhost [127.0.0.1]) by h00609772adf0.ne.client2.attbi.com (8.12.6/8.12.6) with ESMTP id h16ERmhE086095; Thu, 6 Feb 2003 09:27:49 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost) by h00609772adf0.ne.client2.attbi.com (8.12.6/8.12.6/Submit) id h16ERmkf086094; Thu, 6 Feb 2003 09:27:48 -0500 (EST) Date: Thu, 6 Feb 2003 09:27:47 -0500 From: Craig Rodrigues To: Hiten Pandya Cc: freebsd-standards@FreeBSD.ORG Subject: Re: Open POSIX Test Suite project Message-ID: <20030206142747.GA86069@attbi.com> References: <20021216151618.A13539@attbi.com> <20030206140644.GA42617@unixdaemons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030206140644.GA42617@unixdaemons.com> User-Agent: Mutt/1.4i 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 On Thu, Feb 06, 2003 at 09:06:44AM -0500, Hiten Pandya wrote: > I posted this information to the -standards group > before, but no one was excited. ;-) Unfortunately, > the test suite does not run "out-of-the-box" on > FreeBSD, and after muddling around, I could get > some results, which are worth looking at (again): Can you post the results of your fiddling to the posix open test people? They seem to be low-level people from Intel, and don't really seem to be familiar with portable Unix systems programming, because they seem to put a lot of GNU/Linux-isms and bash-isms in their scripts and tests. I had posted a lot of corrections to their scripts, and I don't know if they have been incorporated in their source yet or not. -- Craig Rodrigues http://home.attbi.com/~rodrigc rodrigc@attbi.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Feb 6 17:37: 7 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 F266837B401 for ; Thu, 6 Feb 2003 17:37:02 -0800 (PST) Received: from aol.com (adsl-66-124-9-157.dsl.lsan03.pacbell.net [66.124.9.157]) by mx1.FreeBSD.org (Postfix) with SMTP id 67C6043F75 for ; Thu, 6 Feb 2003 17:36:59 -0800 (PST) (envelope-from GlobeStrat5824@aol.com) Content-Type: text/html; charset="US-ASCII" Date: Thu, 6 Feb 2003 17:36:13 -0800 To: standards@freebsd.org From: GlobeStrat5824@aol.com X-Mailer: Version 5.0 Subject: 2 - 3 hours work = $286 to $1,289 Daily Cash Profit! Organization: Message-Id: <20030207013659.67C6043F75@mx1.FreeBSD.org> 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 25 calls per day to customers EXPECTING your call generates
 

25 calls per day to customers EXPECTING your call generates

$2-7K in hefty commissions per week, on-going.

Have a genuine interest in working from home? Telecommute, working from a virtual office set up in your home, in any city of the U.S. No relocation necessary. You never come to an office. This is a flex-time, flex-place opportunity designed to fit around you and your family’s income and time needs.

You can also work your regular job and do this on the "side", as the hours include part time evenings Monday through Thursday, and also varied daytime & evening hours every other weekend.

Commission Range is  $1,000  -  $9,600

Our product is ‘one of a kind’, and extremely unique. It’s very in demand, and high ticket. What’s more, it can be presented to the prospect in a very simple and uncomplicated way.

Cold calling/phone sales experience is highly preferred.

You must be a disciplined self starter - able to work consistently without needing any motivation from others to get the job done. Do not apply if you are not.

You must be comfortable working non-stop, a minimum of 2 to 3 hours per evening on the phone. Do not apply if you are not.

This is an exceptional opportunity for a few special, top performing; ‘crème de le crème’ persons who love to talk to people and who possess higher than average closing ability. Professional experience in recruiting, insurance, debt collection, or financial products is highly desirable.

Requirements:

    • A resident of the continental United States.
    • Extremely ambitious and driven to achieve high levels of commission.
    • Reliable, outgoing, caring, confident, competitive, & assertive.
    • Comfortable doing high volume out-bound calling.  
    • A self starter with strong autonomy and high initiative; able to work independently and consistently without direct supervision.
    • Able to devote a minimum of 14 hours per week; these hours will vary but include evening hours, and also every other weekend to include various daytime and evening hours.
    • Able to follow scripts, training mandates, directions & etc. to the letter.
    • A strong professional, yet personable phone presence.
    • Superb communication & listening skills.
    • Exceptional time management, organizational, and follow up disciplines.
    • A quiet place in which to work, with minimum disruptions.
    • Your own PC with Microsoft Word, and contact management software.
    • Unlimited internet and e-mail capabilities.
    • An active Long Distance Carrier.
    • A dedicated phone line strictly for business purposes.
    • Able to speak and write clear fluent English.

Our representatives work from their homes as independent contractors and enjoy the independence, convenience and challenge it entails. Top closers earn well over $200,000 per year.

By accommodating the flexibility and family/lifestyle needs of our team members, we’ve found that we can attract the ‘very best’ of the very best. We’re only interested in the highest quality, most mature and stable individuals possible.

Our state of the art technology and communications infrastructure ensures that you are properly supported, and that the virtual working environment is seamless in every way possible.

If this sounds like the perfect opportunity for you, follow the following instructions. Again, if you are not qualified, or you do not meet each and every requirement, please do not apply!  NO exceptions.  Thank you.

Do NOT hit reply to this email, it will not reach us.  Send a separate email to AdminSupport@globestrategic73462.com  **Important- type the word ‘Interested’ in the subject line of your email, (with many email services, you will see the word already typed in the subject line for you). Without the word in the subject line, we will not be reached. **Note-any emails with anything else will not reach us.       **To unsubscribe to this list and/or our partner database lists, please use the convenient removal link provided near the bottom of this email.**

Please save all of your questions for after you have received the information we will be sending to you.

We will respond via email within 24 hours with complete details.

 




You're receiving this email because you agreed to receive offers via email from one of our marketing partners. If you believe you have received this email in error or would like to not receive these special offers, please **DO NOT** reply to this email address, or to any other email address contained herein, (such requests won't reach us, and cannot be processed). Please use the link below and allow up to 72 hours for your request to be processed. You may receive additional e-mail during that time. Thank you for your patience. To be removed simply click here.

To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Feb 6 19:57:22 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 AEA2137B401 for ; Thu, 6 Feb 2003 19:57:02 -0800 (PST) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98BFF43FAF for ; Thu, 6 Feb 2003 19:57:01 -0800 (PST) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id 193199C46; Thu, 6 Feb 2003 22:44:55 -0500 (EST) Date: Thu, 6 Feb 2003 22:44:55 -0500 From: Mike Barcroft To: standards@FreeBSD.org Cc: Bruce Evans Subject: fpclassify() for review Message-ID: <20030206224455.B78590@espresso.q9media.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="eJnRUKwClWJh1Khz" Content-Disposition: inline Organization: The FreeBSD Project 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 --eJnRUKwClWJh1Khz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I'd appreciate reviews of the attached patch which implements C99's fpclassify(). David Schultz and I have been working on it for the last few days. I committed the regression test counterpart yesterday. It's in src/tools/regression/lib/libc/gen. Best regards, Mike Barcroft --eJnRUKwClWJh1Khz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fpclassify4.diff" Implement fpclassify(): o Add a MD header private to libc called _fpmath.h; this header contains bitfield layouts of MD floating-point types. o Add a MI header private to libc called fpmath.h; this header contains bitfield layouts of MI floating-point types. o Add private libc variables for storing infinity and NaN values for `float' and `long double' to lib/libc/$arch/gen/infinity.c. o Add __double_t and __float_t to , and provide double_t and float_t typedefs in . o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF, HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to and others (FLT_EVAL_METHOD, DECIMAL_DIG) to via . o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based on the size of its argument. __fpclassifyl() is never called on alpha because (sizeof(long double) == sizeof(double)), which is good since __fpclassifyl() can't deal with such a small `long double'. This was developed by David Schultz and myself with input from bde and fenner. PR: 23103 Submitted by: David Schultz (significant portions) Index: lib/libc/Makefile =================================================================== RCS file: /work/repo/src/lib/libc/Makefile,v retrieving revision 1.37 diff -u -r1.37 Makefile --- lib/libc/Makefile 18 Nov 2002 09:50:54 -0000 1.37 +++ lib/libc/Makefile 6 Feb 2003 16:56:21 -0000 @@ -10,8 +10,8 @@ # system call stubs. LIB=c SHLIB_MAJOR= 5 -CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include AINC= -I${.CURDIR}/${MACHINE_ARCH} +CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include ${AINC} CLEANFILES+=tags INSTALL_PIC_ARCHIVE= yes PRECIOUSLIB= yes Index: lib/libc/alpha/_fpmath.h =================================================================== RCS file: lib/libc/alpha/_fpmath.h diff -N lib/libc/alpha/_fpmath.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/alpha/_fpmath.h 5 Feb 2003 17:00:29 -0000 @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2002, 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +union IEEEl2bits { + long double e; + struct { + unsigned int manl : 32; + unsigned int manh : 20; + unsigned int exp : 11; + unsigned int sign : 1; + } bits; +}; Index: lib/libc/alpha/gen/infinity.c =================================================================== RCS file: /work/repo/src/lib/libc/alpha/gen/infinity.c,v retrieving revision 1.6 diff -u -r1.6 infinity.c --- lib/libc/alpha/gen/infinity.c 31 Oct 2002 23:05:19 -0000 1.6 +++ lib/libc/alpha/gen/infinity.c 5 Feb 2003 16:21:55 -0000 @@ -34,3 +34,8 @@ /* bytes for +Infinity on an Alpha (IEEE double format) */ const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; +const union __infinity_f_un __infinity_f = { { 0, 0, 0x80, 0x7f } }; +const union __infinity_l_un __infinity_l = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; + +/* bytes for NaN */ +const union __nan_un __nan = { { 0x01, 0, 0x80, 0x7f } }; Index: lib/libc/gen/Makefile.inc =================================================================== RCS file: /work/repo/src/lib/libc/gen/Makefile.inc,v retrieving revision 1.100 diff -u -r1.100 Makefile.inc --- lib/libc/gen/Makefile.inc 30 Jan 2003 21:38:39 -0000 1.100 +++ lib/libc/gen/Makefile.inc 5 Feb 2003 17:31:29 -0000 @@ -9,7 +9,7 @@ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c errno.c \ - exec.c fmtcheck.c fmtmsg.c fnmatch.c fstab.c ftok.c fts.c \ + exec.c fmtcheck.c fmtmsg.c fnmatch.c fpclassify.c fstab.c ftok.c fts.c \ getbootfile.c getbsize.c \ getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \ gethostname.c getloadavg.c getlogin.c getmntinfo.c getnetgrent.c \ @@ -40,7 +40,8 @@ basename.3 check_utility_compat.3 clock.3 \ confstr.3 ctermid.3 daemon.3 \ devname.3 directory.3 dirname.3 dladdr.3 dllockinit.3 dlopen.3 \ - err.3 exec.3 fmtcheck.3 fmtmsg.3 fnmatch.3 frexp.3 ftok.3 fts.3 \ + err.3 exec.3 fmtcheck.3 fmtmsg.3 fnmatch.3 fpclassify.3 frexp.3 \ + ftok.3 fts.3 \ getbootfile.3 getbsize.3 getcap.3 getcontext.3 getcwd.3 \ getdiskbyname.3 getdomainname.3 getfsent.3 \ getgrent.3 getgrouplist.3 gethostname.3 getloadavg.3 \ Index: lib/libc/gen/fpclassify.3 =================================================================== RCS file: lib/libc/gen/fpclassify.3 diff -N lib/libc/gen/fpclassify.3 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/gen/fpclassify.3 6 Feb 2003 22:03:28 -0000 @@ -0,0 +1,81 @@ +.\" Copyright (c) 2003 Mike Barcroft +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 6, 2003 +.Dt FPCLASSIFY 3 +.Os +.Sh NAME +.Nm fpclassify +.Nd "classify a floating-point number" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In math.h +.Ft int +.Fn fpclassify "real-floating x" +.Sh DESCRIPTION +The +.Fn fpclassify +macro takes an argument of +.Va x +and returns one of the following manifest constants. +.Bl -tag -width ".Dv FP_SUBNORMAL" +.It Dv FP_INFINITE +Indicates that +.Va x +is an infinite number. +.It Dv FP_NAN +Indicates that +.Va x +is not a number (NaN). +.It Dv FP_NORMAL +Indicates that +.Va x +is a normalized number. +.It Dv FP_SUBNORMAL +Indicates that +.Va x +is a denormalized number. +.It Dv FP_ZERO +Indicates that +.Va x +is zero (0 or -0). +.El +.Sh SEE ALSO +.Xr math 3 +.Sh STANDARDS +The +.Fn fpclassify +macro conforms to +.St -isoC-99 . +.Sh HISTORY +The +.Fn fpclassify +macro was added in +.Fx 5.1 . +.Sh BUGS +By default, the DEC Alpha architecture does not support IEEE rounding. +See compiler documentation for additional details. Index: lib/libc/gen/fpclassify.c =================================================================== RCS file: lib/libc/gen/fpclassify.c diff -N lib/libc/gen/fpclassify.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/gen/fpclassify.c 5 Feb 2003 17:02:14 -0000 @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2003 Mike Barcroft + * Copyright (c) 2002, 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include + +#include "fpmath.h" + +int +__fpclassifyf(float f) +{ + union IEEEf2bits u; + + u.f = f; + if (u.bits.exp == 0) { + if (u.bits.man == 0) + return (FP_ZERO); + else + return (FP_SUBNORMAL); + } else if (u.bits.exp == 255) { + if (u.bits.man == 0) + return (FP_INFINITE); + else + return (FP_NAN); + } else + return (FP_NORMAL); +} + +int +__fpclassifyd(double d) +{ + union IEEEd2bits u; + + u.d = d; + if (u.bits.exp == 0) { + if ((u.bits.manl | u.bits.manh) == 0) + return (FP_ZERO); + else + return (FP_SUBNORMAL); + } else if (u.bits.exp == 2047) { + if ((u.bits.manl | u.bits.manh) == 0) + return (FP_INFINITE); + else + return (FP_NAN); + } else + return (FP_NORMAL); +} + +int +__fpclassifyl(long double e) +{ + union IEEEl2bits u; + + u.e = e; + if (u.bits.exp == 0) { + if ((u.bits.manl | u.bits.manh) == 0) + return (FP_ZERO); + else + return (FP_SUBNORMAL); + } else if (u.bits.exp == 32767) { + if ((u.bits.manl | u.bits.manh) == 0) + return (FP_INFINITE); + else + return (FP_NAN); + } else + return (FP_NORMAL); +} Index: lib/libc/i386/_fpmath.h =================================================================== RCS file: lib/libc/i386/_fpmath.h diff -N lib/libc/i386/_fpmath.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/i386/_fpmath.h 5 Feb 2003 17:02:46 -0000 @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2002, 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +union IEEEl2bits { + long double e; + struct { + unsigned int manl : 32; + unsigned int manh : 32; + unsigned int exp : 15; + unsigned int sign : 1; + unsigned int junk : 16; + } bits; +}; Index: lib/libc/i386/gen/infinity.c =================================================================== RCS file: /work/repo/src/lib/libc/i386/gen/infinity.c,v retrieving revision 1.9 diff -u -r1.9 infinity.c --- lib/libc/i386/gen/infinity.c 31 Oct 2002 23:05:19 -0000 1.9 +++ lib/libc/i386/gen/infinity.c 6 Feb 2003 17:52:42 -0000 @@ -9,3 +9,9 @@ /* bytes for +Infinity on a 387 */ const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; +const union __infinity_f_un __infinity_f = { { 0, 0, 0x80, 0x7f } }; +const union __infinity_l_un __infinity_l = + { { 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0x7f, 0, 0 } }; + +/* bytes for NaN */ +const union __nan_un __nan = { { 0x01, 0, 0x80, 0x7f } }; Index: lib/libc/ia64/_fpmath.h =================================================================== RCS file: lib/libc/ia64/_fpmath.h diff -N lib/libc/ia64/_fpmath.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/ia64/_fpmath.h 5 Feb 2003 17:03:31 -0000 @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2003 Mike Barcroft + * Copyright (c) 2002, 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +union IEEEl2bits { + long double e; + struct { + unsigned long manl : 64; + unsigned long manh : 48; + unsigned int exp : 15; + unsigned int sign : 1; + } bits; +}; Index: lib/libc/ia64/gen/infinity.c =================================================================== RCS file: /work/repo/src/lib/libc/ia64/gen/infinity.c,v retrieving revision 1.5 diff -u -r1.5 infinity.c --- lib/libc/ia64/gen/infinity.c 31 Oct 2002 23:05:19 -0000 1.5 +++ lib/libc/ia64/gen/infinity.c 5 Feb 2003 16:21:55 -0000 @@ -34,3 +34,9 @@ /* bytes for +Infinity on an ia64 (IEEE double format) */ const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; +const union __infinity_f_un __infinity_f = { { 0, 0, 0x80, 0x7f } }; +const union __infinity_l_un __infinity_l = + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0x7f } }; + +/* bytes for NaN */ +const union __nan_un __nan = { { 0x01, 0, 0x80, 0x7f } }; Index: lib/libc/powerpc/_fpmath.h =================================================================== RCS file: lib/libc/powerpc/_fpmath.h diff -N lib/libc/powerpc/_fpmath.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/powerpc/_fpmath.h 6 Feb 2003 21:56:47 -0000 @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +union IEEEl2bits { + long double e; + struct { + unsigned int sign : 1; + unsigned int exp : 15; + unsigned long manh : 48; + unsigned long manl : 64; + } bits; +}; Index: lib/libc/powerpc/gen/infinity.c =================================================================== RCS file: /work/repo/src/lib/libc/powerpc/gen/infinity.c,v retrieving revision 1.1 diff -u -r1.1 infinity.c --- lib/libc/powerpc/gen/infinity.c 4 Dec 2002 07:25:14 -0000 1.1 +++ lib/libc/powerpc/gen/infinity.c 5 Feb 2003 16:21:55 -0000 @@ -12,3 +12,9 @@ /* bytes for +Infinity on powerpc */ const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; +const union __infinity_f_un __infinity_f = { { 0x7f, 0x80, 0, 0 } }; +const union __infinity_l_un __infinity_l = + { { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; + +/* bytes for NaN */ +const union __nan_un __nan = { { 0x7f, 0x80, 0, 0x01 } }; Index: lib/libc/sparc64/_fpmath.h =================================================================== RCS file: lib/libc/sparc64/_fpmath.h diff -N lib/libc/sparc64/_fpmath.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/sparc64/_fpmath.h 5 Feb 2003 17:03:57 -0000 @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2003 Mike Barcroft + * Copyright (c) 2002, 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +union IEEEl2bits { + long double e; + struct { + unsigned int sign : 1; + unsigned int exp : 15; + unsigned long manh : 48; + unsigned long manl : 64; + } bits; +}; Index: lib/libc/sparc64/gen/infinity.c =================================================================== RCS file: /work/repo/src/lib/libc/sparc64/gen/infinity.c,v retrieving revision 1.6 diff -u -r1.6 infinity.c --- lib/libc/sparc64/gen/infinity.c 31 Oct 2002 23:05:19 -0000 1.6 +++ lib/libc/sparc64/gen/infinity.c 5 Feb 2003 16:21:55 -0000 @@ -12,3 +12,9 @@ /* bytes for +Infinity on a sparc */ const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; +const union __infinity_f_un __infinity_f = { { 0x7f, 0x80, 0, 0 } }; +const union __infinity_l_un __infinity_l = + { { 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; + +/* bytes for NaN */ +const union __nan_un __nan = { { 0x7f, 0x80, 0, 0x01 } }; Index: lib/msun/src/math.h =================================================================== RCS file: /work/repo/src/lib/msun/src/math.h,v retrieving revision 1.20 diff -u -r1.20 math.h --- lib/msun/src/math.h 31 Oct 2002 23:05:20 -0000 1.20 +++ lib/msun/src/math.h 6 Feb 2003 18:04:20 -0000 @@ -17,6 +17,8 @@ #ifndef _MATH_H_ #define _MATH_H_ +#include + /* * ANSI/POSIX */ @@ -24,7 +26,43 @@ unsigned char __uc[8]; double __ud; } __infinity; + +extern const union __infinity_f_un { + unsigned char __uc[sizeof(float)]; + float __uf; +} __infinity_f; + +extern const union __infinity_l_un { + unsigned char __uc[sizeof(long double)]; + long double __ul; +} __infinity_l; + +extern const union __nan_un { + unsigned char __uc[sizeof(float)]; + float __uf; +} __nan; + +#define FP_ILOGB0 (-0x7fffffff - 1) /* INT_MIN */ +#define FP_ILOGBNAN 0x7fffffff /* INT_MAX */ #define HUGE_VAL (__infinity.__ud) +#define HUGE_VALF (__infinity_f.__uf) +#define HUGE_VALL (__infinity_l.__ul) +#define INFINITY HUGE_VALF +#define NAN (__nan.__uf) + +/* Symbolic constants to classify floating point numbers */ +#define FP_INFINITE 1 +#define FP_NAN 2 +#define FP_NORMAL 3 +#define FP_SUBNORMAL 4 +#define FP_ZERO 5 +#define fpclassify(x) \ + ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \ + : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \ + : __fpclassifyl(x)) + +typedef __double_t double_t; +typedef __float_t float_t; /* * XOPEN/SVID @@ -116,6 +154,10 @@ /* * ANSI/POSIX */ +int __fpclassifyd(double); +int __fpclassifyf(float); +int __fpclassifyl(long double); + double acos(double); double asin(double); double atan(double); Index: sys/alpha/include/_types.h =================================================================== RCS file: /work/repo/src/sys/alpha/include/_types.h,v retrieving revision 1.2 diff -u -r1.2 _types.h --- sys/alpha/include/_types.h 23 Aug 2002 16:49:04 -0000 1.2 +++ sys/alpha/include/_types.h 5 Feb 2003 16:23:59 -0000 @@ -56,6 +56,8 @@ */ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; +typedef double __double_t; +typedef float __float_t; typedef __int64_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int64_t __intptr_t; Index: sys/alpha/include/float.h =================================================================== RCS file: /work/repo/src/sys/alpha/include/float.h,v retrieving revision 1.3 diff -u -r1.3 float.h --- sys/alpha/include/float.h 20 Mar 2002 18:58:45 -0000 1.3 +++ sys/alpha/include/float.h 5 Feb 2003 16:58:15 -0000 @@ -45,6 +45,8 @@ #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS __flt_rounds() +#define FLT_EVAL_METHOD 0 /* no promotions */ +#define DECIMAL_DIG 17 /* max precision in decimal digits */ #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ Index: sys/i386/include/_types.h =================================================================== RCS file: /work/repo/src/sys/i386/include/_types.h,v retrieving revision 1.4 diff -u -r1.4 _types.h --- sys/i386/include/_types.h 1 Oct 2002 14:07:18 -0000 1.4 +++ sys/i386/include/_types.h 5 Feb 2003 16:25:18 -0000 @@ -69,6 +69,8 @@ */ typedef unsigned long __clock_t; /* clock()... */ typedef __int32_t __critical_t; +typedef double __double_t; +typedef double __float_t; typedef __int32_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int32_t __intptr_t; Index: sys/i386/include/float.h =================================================================== RCS file: /work/repo/src/sys/i386/include/float.h,v retrieving revision 1.9 diff -u -r1.9 float.h --- sys/i386/include/float.h 25 Oct 2002 07:02:52 -0000 1.9 +++ sys/i386/include/float.h 5 Feb 2003 16:59:10 -0000 @@ -39,6 +39,8 @@ #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS 1 /* FP addition rounds to nearest */ +#define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */ +#define DECIMAL_DIG 21 /* max precision in decimal digits */ #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ Index: sys/ia64/include/_types.h =================================================================== RCS file: /work/repo/src/sys/ia64/include/_types.h,v retrieving revision 1.4 diff -u -r1.4 _types.h --- sys/ia64/include/_types.h 15 Nov 2002 22:35:34 -0000 1.4 +++ sys/ia64/include/_types.h 5 Feb 2003 16:24:45 -0000 @@ -56,6 +56,8 @@ */ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; +typedef double __double_t; +typedef float __float_t; typedef __int64_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int64_t __intptr_t; Index: sys/ia64/include/float.h =================================================================== RCS file: /work/repo/src/sys/ia64/include/float.h,v retrieving revision 1.2 diff -u -r1.2 float.h --- sys/ia64/include/float.h 6 Oct 2001 15:57:22 -0000 1.2 +++ sys/ia64/include/float.h 5 Feb 2003 16:58:36 -0000 @@ -41,6 +41,8 @@ #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS 1 /* FP addition rounds to nearest */ +#define FLT_EVAL_METHOD 0 /* no promotions */ +#define DECIMAL_DIG 35 /* max precision in decimal digits */ #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ Index: sys/powerpc/include/_types.h =================================================================== RCS file: /work/repo/src/sys/powerpc/include/_types.h,v retrieving revision 1.3 diff -u -r1.3 _types.h --- sys/powerpc/include/_types.h 18 Jan 2003 11:18:42 -0000 1.3 +++ sys/powerpc/include/_types.h 6 Feb 2003 21:59:12 -0000 @@ -69,6 +69,8 @@ */ typedef __uint32_t __clock_t; /* clock()... */ typedef __int32_t __critical_t; +typedef double __double_t; +typedef double __float_t; typedef __int32_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int32_t __intptr_t; Index: sys/powerpc/include/float.h =================================================================== RCS file: /work/repo/src/sys/powerpc/include/float.h,v retrieving revision 1.1 diff -u -r1.1 float.h --- sys/powerpc/include/float.h 15 May 2002 20:54:35 -0000 1.1 +++ sys/powerpc/include/float.h 6 Feb 2003 21:58:32 -0000 @@ -40,6 +40,8 @@ #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS 1 /* FP addition rounds to nearest */ +#define FLT_EVAL_METHOD 1 /* operands promoted to double */ +#define DECIMAL_DIG 35 /* max precision in decimal digits */ #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ Index: sys/sparc64/include/_types.h =================================================================== RCS file: /work/repo/src/sys/sparc64/include/_types.h,v retrieving revision 1.2 diff -u -r1.2 _types.h --- sys/sparc64/include/_types.h 23 Aug 2002 16:49:06 -0000 1.2 +++ sys/sparc64/include/_types.h 5 Feb 2003 16:26:38 -0000 @@ -56,6 +56,8 @@ */ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; +typedef double __double_t; +typedef float __float_t; typedef __int64_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int64_t __intptr_t; Index: sys/sparc64/include/float.h =================================================================== RCS file: /work/repo/src/sys/sparc64/include/float.h,v retrieving revision 1.2 diff -u -r1.2 float.h --- sys/sparc64/include/float.h 21 Mar 2002 00:06:55 -0000 1.2 +++ sys/sparc64/include/float.h 5 Feb 2003 16:59:21 -0000 @@ -55,6 +55,8 @@ #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS __flt_rounds() +#define FLT_EVAL_METHOD 0 /* no promotion */ +#define DECIMAL_DIG 35 /* max precision in decimal digits */ #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-7F /* b**(1-p) */ --eJnRUKwClWJh1Khz-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Feb 6 22:14:21 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 E05A437B401; Thu, 6 Feb 2003 22:14:20 -0800 (PST) Received: from smtp04.iprimus.com.au (smtp04.iprimus.com.au [210.50.76.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC86D43F3F; Thu, 6 Feb 2003 22:14:19 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from smtp02.iprimus.net.au (210.50.76.70) by smtp04.iprimus.com.au (6.7.010) id 3E41F7230002F831; Fri, 7 Feb 2003 17:14:13 +1100 Received: from dilbert.robbins.dropbear.id.au ([210.50.88.90]) by smtp02.iprimus.net.au with Microsoft SMTPSVC(5.0.2195.5600); Fri, 7 Feb 2003 17:14:11 +1100 Received: from dilbert.robbins.dropbear.id.au (t4csbpecwxb9vnty@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6) with ESMTP id h176E8kC099892; Fri, 7 Feb 2003 17:14:09 +1100 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6/Submit) id h176E22w099891; Fri, 7 Feb 2003 17:14:02 +1100 (EST) (envelope-from tim) Date: Fri, 7 Feb 2003 17:14:02 +1100 From: Tim Robbins To: Mike Barcroft Cc: standards@FreeBSD.ORG, Bruce Evans Subject: Re: fpclassify() for review Message-ID: <20030207171402.A99670@dilbert.robbins.dropbear.id.au> References: <20030206224455.B78590@espresso.q9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030206224455.B78590@espresso.q9media.com>; from mike@FreeBSD.ORG on Thu, Feb 06, 2003 at 10:44:55PM -0500 X-OriginalArrivalTime: 07 Feb 2003 06:14:12.0617 (UTC) FILETIME=[22417790:01C2CE70] 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 On Thu, Feb 06, 2003 at 10:44:55PM -0500, Mike Barcroft wrote: > o Add a MI header private to libc called fpmath.h; this header > contains bitfield layouts of MI floating-point types. This file seems to be missing from the diff. Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 8: 1:46 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 B777037B401; Fri, 7 Feb 2003 08:01:43 -0800 (PST) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 242A143F85; Fri, 7 Feb 2003 08:01:43 -0800 (PST) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id E4F339C4A; Fri, 7 Feb 2003 10:49:35 -0500 (EST) Date: Fri, 7 Feb 2003 10:49:35 -0500 From: Mike Barcroft To: Tim Robbins Cc: standards@FreeBSD.ORG, Bruce Evans Subject: Re: fpclassify() for review Message-ID: <20030207104935.A88550@espresso.q9media.com> References: <20030206224455.B78590@espresso.q9media.com> <20030207171402.A99670@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <20030207171402.A99670@dilbert.robbins.dropbear.id.au>; from tjr@FreeBSD.ORG on Fri, Feb 07, 2003 at 05:14:02PM +1100 Organization: The FreeBSD Project 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 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Tim Robbins writes: > On Thu, Feb 06, 2003 at 10:44:55PM -0500, Mike Barcroft wrote: > > > o Add a MI header private to libc called fpmath.h; this header > > contains bitfield layouts of MI floating-point types. > > This file seems to be missing from the diff. Oops, forgot to lcvs add. It's attached to this e-mail. Best regards, Mike Barcroft --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fpmath.diff" Index: lib/libc/include/fpmath.h =================================================================== RCS file: lib/libc/include/fpmath.h diff -N lib/libc/include/fpmath.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/include/fpmath.h 5 Feb 2003 16:21:55 -0000 @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2003 Mike Barcroft + * Copyright (c) 2002 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include "_fpmath.h" + +union IEEEf2bits { + float f; + struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int man : 23; + unsigned int exp : 8; + unsigned int sign : 1; +#else /* _BIG_ENDIAN */ + unsigned int sign : 1; + unsigned int exp : 8; + unsigned int man : 23; +#endif + } bits; +}; + +union IEEEd2bits { + double d; + struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int manl : 32; + unsigned int manh : 20; + unsigned int exp : 11; + unsigned int sign : 1; +#else /* _BIG_ENDIAN */ + unsigned int sign : 1; + unsigned int exp : 11; + unsigned int manh : 20; + unsigned int manl : 32; +#endif + } bits; +}; --OXfL5xGRrasGEqWY-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 10:25:10 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 023A137B401; Fri, 7 Feb 2003 10:25:10 -0800 (PST) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 407AA43FCB; Fri, 7 Feb 2003 10:25:09 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.6/8.12.6) with ESMTP id h17IP7bs081763 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 7 Feb 2003 13:25:08 -0500 (EST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.6/8.12.6/Submit) id h17IP4s7081758; Fri, 7 Feb 2003 13:25:04 -0500 (EST) (envelope-from wollman) Date: Fri, 7 Feb 2003 13:25:04 -0500 (EST) From: Garrett Wollman Message-Id: <200302071825.h17IP4s7081758@khavrinen.lcs.mit.edu> To: Mike Barcroft Cc: standards@FreeBSD.ORG, Bruce Evans Subject: fpclassify() for review In-Reply-To: <20030206224455.B78590@espresso.q9media.com> References: <20030206224455.B78590@espresso.q9media.com> 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 I think that, if we had some help from the compiler, it ought to be possible to implement FLT_EVAL_METHOD == 2 for i386, and that's probably the closest to the actual hardware implementation. Something similar to Kahan's PARANOIA ought to be able to distinguish the various methods and thereby serve as a regression test. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 10:55:46 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 1619037B401 for ; Fri, 7 Feb 2003 10:55:45 -0800 (PST) Received: from mailbox.univie.ac.at (mail.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB65C43F3F for ; Fri, 7 Feb 2003 10:55:43 -0800 (PST) (envelope-from l.ertl@univie.ac.at) Received: from adslle.cc.univie.ac.at (adslle.cc.univie.ac.at [131.130.102.11]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h17ItYt3247210 for ; Fri, 7 Feb 2003 19:55:38 +0100 Date: Fri, 7 Feb 2003 19:55:34 +0100 (CET) From: Lukas Ertl To: standards@FreeBSD.ORG Subject: C99 floating point macros Message-ID: <20030207194848.N353@leelou.in.tern> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-mailbox-Metrics: mailbox 4251; Body=1 Fuz1=1 Fuz2=1 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 Hello standards, 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? *) Regarding different architectures: is there anything I need to take care of? *) Can I just use isnan(3) for input validation? *) So, the basic question is: where should I start? :-) I hope I'm getting some input from you. thanks, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 12:24:30 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 A993137B401 for ; Fri, 7 Feb 2003 12:24:29 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE7CD43FBF for ; Fri, 7 Feb 2003 12:24:28 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.6/8.12.3) with ESMTP id h17KON3Y052581; Fri, 7 Feb 2003 13:24:23 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 07 Feb 2003 13:21:05 -0700 (MST) Message-Id: <20030207.132105.67900720.imp@bsdimp.com> To: ben@timing.com Cc: freebsd-standards@FreeBSD.ORG Subject: Re: proposed patch to math.h & lgamma(3) manpage From: "M. Warner Losh" In-Reply-To: <15937.30772.290602.974328@piglet.timing.com> References: <15937.30772.290602.974328@piglet.timing.com> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 This patch looks good to me, and seems to implement the consensus that was arrived at here. I'll commit this in a day or so if there aren't any objections posted before then. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 14:20:23 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 7FBE837B401; Fri, 7 Feb 2003 14:20:22 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 803C643FA3; Fri, 7 Feb 2003 14:20:21 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.6/8.12.3) with ESMTP id h17MKA3Y053357; Fri, 7 Feb 2003 15:20:11 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 07 Feb 2003 15:16:52 -0700 (MST) Message-Id: <20030207.151652.38309440.imp@bsdimp.com> To: wollman@lcs.mit.edu Cc: mike@FreeBSD.ORG, standards@FreeBSD.ORG, bde@zeta.org.au Subject: Re: fpclassify() for review From: "M. Warner Losh" In-Reply-To: <200302071825.h17IP4s7081758@khavrinen.lcs.mit.edu> References: <20030206224455.B78590@espresso.q9media.com> <200302071825.h17IP4s7081758@khavrinen.lcs.mit.edu> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 In message: <200302071825.h17IP4s7081758@khavrinen.lcs.mit.edu> Garrett Wollman writes: : I think that, if we had some help from the compiler, it ought to be : possible to implement FLT_EVAL_METHOD == 2 for i386, and that's : probably the closest to the actual hardware implementation. Something : similar to Kahan's PARANOIA ought to be able to distinguish the : various methods and thereby serve as a regression test. What's FLT_EVAL_METHOD == 2 mean? I'd love to make the long doubles actually have their full range by default. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 14:33:41 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 44CB737B401 for ; Fri, 7 Feb 2003 14:33:40 -0800 (PST) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9027B43FA3 for ; Fri, 7 Feb 2003 14:33:39 -0800 (PST) (envelope-from stefan@fafoe.dyndns.org) Received: from frog.fafoe (frog.fafoe [192.168.2.101]) by fafoe.dyndns.org (Postfix) with ESMTP id A10C54066; Fri, 7 Feb 2003 23:33:37 +0100 (CET) Received: by frog.fafoe (Postfix, from userid 1001) id 695A8253; Fri, 7 Feb 2003 23:33:36 +0100 (CET) Date: Fri, 7 Feb 2003 23:33:36 +0100 From: Stefan Farfeleder To: "M. Warner Losh" Cc: standards@FreeBSD.ORG Subject: Re: fpclassify() for review Message-ID: <20030207223336.GB620@frog.fafoe> Mail-Followup-To: "M. Warner Losh" , standards@FreeBSD.ORG References: <20030206224455.B78590@espresso.q9media.com> <200302071825.h17IP4s7081758@khavrinen.lcs.mit.edu> <20030207.151652.38309440.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030207.151652.38309440.imp@bsdimp.com> User-Agent: Mutt/1.5.3i 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 On Fri, Feb 07, 2003 at 03:16:52PM -0700, M. Warner Losh wrote: > In message: <200302071825.h17IP4s7081758@khavrinen.lcs.mit.edu> > Garrett Wollman writes: > : I think that, if we had some help from the compiler, it ought to be > : possible to implement FLT_EVAL_METHOD == 2 for i386, and that's > : probably the closest to the actual hardware implementation. Something > : similar to Kahan's PARANOIA ought to be able to distinguish the > : various methods and thereby serve as a regression test. > > What's FLT_EVAL_METHOD == 2 mean? > > I'd love to make the long doubles actually have their full range by > default. 5.2.4.2.2 Characteristics of floating types 7 The values of operations with floating operands and values subject to the usual arithmetic conversions and of floating constants are evaluated to a format whose range and precision may be greater than required by the type. The use of evaluation formats is characterized by the implementation-defined value of FLT_EVAL_METHOD:19) -1 indeterminable; 0 evaluate all operations and constants just to the range and precision of the type; 1 evaluate operations and constants of type float and double to the range and precision of the double type, evaluate long double operations and constants to the range and precision of the long double type; 2 evaluate all operations and constants to the range and precision of the long double type. Regards, Stefan Farfeleder To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 14:37:48 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 190ED37B401 for ; Fri, 7 Feb 2003 14:37:48 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50B7843FA3 for ; Fri, 7 Feb 2003 14:37:47 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.6/8.12.3) with ESMTP id h17Mbh3Y053394; Fri, 7 Feb 2003 15:37:43 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 07 Feb 2003 15:34:24 -0700 (MST) Message-Id: <20030207.153424.67808197.imp@bsdimp.com> To: stefan@fafoe.dyndns.org Cc: standards@FreeBSD.ORG Subject: Re: fpclassify() for review From: "M. Warner Losh" In-Reply-To: <20030207223336.GB620@frog.fafoe> References: <200302071825.h17IP4s7081758@khavrinen.lcs.mit.edu> <20030207.151652.38309440.imp@bsdimp.com> <20030207223336.GB620@frog.fafoe> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Thanks for the info. I'm with Garrett then. I'd love to see and will help work towards. Ben has also expressed similar interests. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 16: 0:44 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 09E0E37B40D for ; Fri, 7 Feb 2003 16:00:42 -0800 (PST) Received: from citymail.com.tw (148.1.30.61.isp.tfn.net.tw [61.30.1.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F15443FB1 for ; Fri, 7 Feb 2003 16:00:16 -0800 (PST) (envelope-from chin1122@citymail.com.tw) From: jerry@FreeBSD.ORG Subject: ¦¬¤J¼W¥[ªº¤èªk Reply-To: ch1n1122@citymail.com.tw Date: 08 Feb 2003 08:20:29 +0800 Organization: Foobar Inc. X-Mailer: Gammadyne Mailer x-delete-me: 1 (this tells Gammadyne's server to delete the message) MIME-Version: 1.0 Content-Type: text/html Content-Transfer-Encoding: 8bit Message-Id: <20030208000016.1F15443FB1@mx1.FreeBSD.org> To: undisclosed-recipients: ; 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 ¦L¶r¾÷

·s¦~§ª«°e±z¤@¥x¦L¶r¾÷ ...

To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Feb 7 19: 0:32 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 C56AD37B405 for ; Fri, 7 Feb 2003 19:00:31 -0800 (PST) Received: from citymail.com.tw (adsl-sta-tpe-64-199-133.so-net.net.tw [61.64.199.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0798543FF3 for ; Fri, 7 Feb 2003 19:00:29 -0800 (PST) (envelope-from chin1122@citymail.com.tw) From: jerry@FreeBSD.ORG Subject: ¦¬¤J¼W¥[ªº¤èªk Reply-To: ch1n1122@citymail.com.tw Date: 08 Feb 2003 11:20:32 +0800 Organization: Foobar Inc. X-Mailer: Gammadyne Mailer x-delete-me: 1 (this tells Gammadyne's server to delete the message) MIME-Version: 1.0 Content-Type: text/html Content-Transfer-Encoding: 8bit Message-Id: <20030208030030.0798543FF3@mx1.FreeBSD.org> To: undisclosed-recipients: ; 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 ¦L¶r¾÷

·s¦~§ª«°e±z¤@¥x¦L¶r¾÷ ...

To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Feb 8 2: 3:52 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 604A237B401; Sat, 8 Feb 2003 02:03:50 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1575343F75; Sat, 8 Feb 2003 02:03:49 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id VAA26880; Sat, 8 Feb 2003 21:03:26 +1100 Date: Sat, 8 Feb 2003 21:03:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Garrett Wollman Cc: Mike Barcroft , Subject: Re: fpclassify() for review In-Reply-To: <200302071825.h17IP4s7081758@khavrinen.lcs.mit.edu> Message-ID: <20030208201529.E16550-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Fri, 7 Feb 2003, Garrett Wollman wrote: > I think that, if we had some help from the compiler, it ought to be > possible to implement FLT_EVAL_METHOD == 2 for i386, and that's > probably the closest to the actual hardware implementation. Something This is intentionally not done. i386.md intentionally claims that the hardware implements method 0 (float + float -> float, etc.). This is a bad efficiency hack. Since the hardware actually implements float + float -> pseudo-float := , etc., this gives various bugs. The bugs are intentionally reduced by changing the precision from its hardware default of 64 bits to 53 bits. > similar to Kahan's PARANOIA ought to be able to distinguish the > various methods and thereby serve as a regression test. gcc/enquire.c is better for this. PARANIOA is better for detecting broken clipping of excess precision. Both ENQUIRE and PARANOIA are sensitive to precision, but PARANIOA expects precision errors to some extent so the errors are easier to isolate. Changing the FreeBSD default back to the hardware default causes the following regressions in PARANOIA output: %%% --- paranonia-53bitprecision.out Sat Feb 8 20:42:54 2003 +++ paranonia-64bitprecision.out Sat Feb 8 20:42:50 2003 @@ -98,2 +98,6 @@ The number of significant digits of the Radix is 53.000000 . +Some subexpressions appear to be calculated extra +precisely with about 11 extra B-digits, i.e. +roughly 3.31133 extra significant decimals. +That feature is not tested further by this program. @@ -110,7 +114,8 @@ Checking rounding on multiply, divide and add/subtract. -Multiplication appears to round correctly. -Division appears to round correctly. -Addition/Subtraction appears to round correctly. -Checking for sticky bit. -Sticky bit apparently used correctly. +* is neither chopped nor correctly rounded. +/ is neither chopped nor correctly rounded. +Addition/Subtraction neither rounds nor chops. +Sticky bit used incorrectly or not at all. +FLAW: lack(s) of guard digits or failure(s) to correctly round or chop +(noted above) count as one flaw in the final tally below. @@ -124,3 +129,4 @@ Testing whether sqrt is rounded or chopped. -Square root appears to be correctly rounded. +Square root is neither chopped nor correctly rounded. +Observed errors run from -5.0000000e-01 to 5.0000000e-01 ulps. @@ -184,7 +190,5 @@ +The number of FLAWs discovered = 1. -No failures, defects nor flaws have been discovered. -Rounding appears to conform to the proposed IEEE standard P754, -except for possibly Double Rounding during Gradual Underflow. -The arithmetic diagnosed appears to be Excellent! +The arithmetic diagnosed seems Satisfactory though flawed. END OF TEST. %%% This is with a 1988 version of paranoia.c. The gcc bugs are at least as old. Note that the bug is not extra precision; it is misimplementation of extra precision. PARANIOA understands extra precision and assigns the results of expressions to variables to get rid of it, but gcc doesn't perform the necessary conversions for these assignments because of the hacks in i386.md. PARANIOA works right when compiled with -ffloat-store since it doesn't trust casts and always uses assignments to clip the extra precision. Casts and assignments are supposed to cause the same conversions, but the -ffloat-store hack only works for assignments. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Feb 8 3:26:23 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 7BA9A37B401 for ; Sat, 8 Feb 2003 03:26:22 -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 CCDA643FAF for ; Sat, 8 Feb 2003 03:26:21 -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 h18BQKYP016165; Sat, 8 Feb 2003 03:26:20 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h18BQKr6016164; Sat, 8 Feb 2003 03:26:20 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sat, 8 Feb 2003 03:26:19 -0800 From: David Schultz To: Lukas Ertl Cc: standards@FreeBSD.ORG Subject: Re: C99 floating point macros Message-ID: <20030208112619.GA15718@HAL9000.homeunix.com> Mail-Followup-To: Lukas Ertl , standards@FreeBSD.ORG References: <20030207194848.N353@leelou.in.tern> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030207194848.N353@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 : > 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. > *) Regarding different architectures: is there anything I need to take > care of? I have some MI patches for these; they're all one-liners, but they involve calls to fpclassify(). (I guess isnan() would be better, as you suggest.) They would be several times faster if implemented in an MD manner (e.g. the fucom instruction for the i387), but I don't know if anyone cares. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Feb 8 4: 9:46 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 437EB37B401 for ; Sat, 8 Feb 2003 04:09:37 -0800 (PST) Received: from mailbox.univie.ac.at (mail.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11C6443FD7 for ; Sat, 8 Feb 2003 04:09:36 -0800 (PST) (envelope-from l.ertl@univie.ac.at) Received: from adslle.cc.univie.ac.at (adslle.cc.univie.ac.at [131.130.102.11]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h18C9Pt3181938; Sat, 8 Feb 2003 13:09:28 +0100 Date: Sat, 8 Feb 2003 13:09:25 +0100 (CET) From: Lukas Ertl To: David Schultz Cc: standards@FreeBSD.ORG Subject: Re: C99 floating point macros In-Reply-To: <20030208112619.GA15718@HAL9000.homeunix.com> Message-ID: <20030208130529.C355@leelou.in.tern> References: <20030207194848.N353@leelou.in.tern> <20030208112619.GA15718@HAL9000.homeunix.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: mx1 4261; Body=2 Fuz1=2 Fuz2=2 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 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. :-) --8<-- Index: lib/libc/gen/Makefile.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /u/cvs/cvs/src/lib/libc/gen/Makefile.inc,v retrieving revision 1.100 diff -u -r1.100 Makefile.inc --- lib/libc/gen/Makefile.inc=0930 Jan 2003 21:38:39 -0000=091.100 +++ lib/libc/gen/Makefile.inc=098 Feb 2003 12:03:44 -0000 @@ -16,7 +16,7 @@ =09getobjformat.c getosreldate.c getpagesize.c \ =09getpeereid.c getprogname.c getpwent.c getttyent.c \ =09getusershell.c getvfsbyname.c getvfsent.c glob.c \ -=09initgroups.c isatty.c jrand48.c lcong48.c \ +=09initgroups.c isatty.c isgreater.c jrand48.c lcong48.c \ =09lockf.c lrand48.c mrand48.c nice.c \ =09nlist.c nrand48.c ntp_gettime.c opendir.c \ =09pause.c popen.c posixshm.c pselect.c psignal.c pw_scan.c pwcache.c \ @@ -47,7 +47,7 @@ =09getmntinfo.3 getnetgrent.3 getobjformat.3 getosreldate.3 \ =09getpagesize.3 getpass.3 getpeereid.3 getprogname.3 getpwent.3 \ =09getttyent.3 getusershell.3 getvfsbyname.3 getvfsent.3 \ -=09glob.3 initgroups.3 isinf.3 ldexp.3 lockf.3 makecontext.3 \ +=09glob.3 initgroups.3 isgreater.3 isinf.3 ldexp.3 lockf.3 makecontext.3 \ =09modf.3 msgctl.3 msgget.3 msgrcv.3 msgsnd.3 \ =09nice.3 nlist.3 pause.3 popen.3 pselect.3 psignal.3 pwcache.3 \ =09raise.3 rand48.3 readpassphrase.3 rfork_thread.3 \ @@ -97,6 +97,9 @@ =09getvfsent.3 setvfsent.3 getvfsent.3 vfsisloadable.3 \ =09getvfsent.3 vfsload.3 MLINKS+=3Dglob.3 globfree.3 +MLINKS+=3Disgreater.3 isgreaterequal.3 isgreater.3 isless.3 \ +=09=09isgreater.3 islessequal.3 isgreater.3 islessgreater.3 \ +=09=09isgreater.3 isunordered.3 MLINKS+=3Disinf.3 isnan.3 isinf.3 isnanf.3 MLINKS+=3Dmakecontext.3 swapcontext.3 MLINKS+=3Dpopen.3 pclose.3 Index: lib/libc/gen/isgreater.3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: lib/libc/gen/isgreater.3 diff -N lib/libc/gen/isgreater.3 --- /dev/null=091 Jan 1970 00:00:00 -0000 +++ lib/libc/gen/isgreater.3=098 Feb 2003 12:03:44 -0000 @@ -0,0 +1,121 @@ +.\" Copyright (c) 2003 Lukas Ertl +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution= =2E +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PUR= POSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABL= E +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN= TIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOOD= S +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, ST= RICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY = WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 8, 2003 +.Dt ISGREATER 3 +.Os +.Sh NAME +.Nm isgreater , +.Nm isgreaterequal , +.Nm isless , +.Nm islessequal , +.Nm islessgreater , +.Nm isunordered +.Nd "test if x is less or greater than y" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In math.h +.Ft int +.Fn isgreater "real-floating x" "real-floating y" +.Ft int +.Fn isgreaterequal "real-floating x" "real-floating y" +.Ft int +.Fn isless "real-floating x" "real-floating y" +.Ft int +.Fn islessequal "real-floating x" "real-floating y" +.Ft int +.Fn islessgreater "real-floating x" "real-floating y" +.Ft int +.Fn isunordered "real-floating x" "real-floating y" +.Sh DESCRIPTION +The +.Fn isgreater +macro returns 1 if argument +.Va x +is greater than argument +.Va y , +or 0 otherwise. +.Pp +The +.Fn isgreaterequal +macro returns 1 if argument +.Va x +is greater than or equal to argument +.Va y , +or 0 otherwise. +.Pp +The +.Fn isless +macro returns 1 if argument +.Va x +is less than argument +.Va y , +or 0 otherwise. +.Pp +The +.Fn islessequal +macro returns 1 if argument +.Va x +is less than or equal to argument +.Va y , +or 0 otherwise. +.Pp +The +.Fn islessgreater +macro returns 1 if argument +.Va x +is less than or greater than argument +.Va y , +or 0 otherwise. +.Pp +The +.Fn isunordered +macro returns 1 its arguments are unordered or 0 otherwise. +.Sh SEE ALSO +.Xr math 3 +.Sh STANDARDS +The +.Fn isgreater , +.Fn isgreaterequal , +.Fn isless , +.Fn islessequal , +.Fn islessgreater +and +.Fn isunordered +macros conform to +.St -isoC-99 . +.Sh HISTORY +The +.Fn isgreater , +.Fn isgreaterequal , +.Fn isless , +.Fn islessequal , +.Fn islessgreater +and +.Fn isunordered +macros were added in +.Fx 5.1 . Index: lib/libc/gen/isgreater.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: lib/libc/gen/isgreater.c diff -N lib/libc/gen/isgreater.c --- /dev/null=091 Jan 1970 00:00:00 -0000 +++ lib/libc/gen/isgreater.c=098 Feb 2003 12:03:44 -0000 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2003 Lukas Ertl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP= OSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENT= IAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STR= ICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY W= AY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +int +_isgreater(double x, double y) +{ + if (isnan(x) || isnan(y)) + return 0; + + return (x > y); +} + +int +_isgreaterequal(double x, double y) +{ + if (isnan(x) || isnan(y)) + return 0; + + return (x >=3D y); +} + +int +_isless(double x, double y) +{ + if (isnan(x) || isnan(y)) + return 0; + + return (x < y); +} + +int +_islessequal(double x, double y) +{ + if (isnan(x) || isnan(y)) + return 0; + + return (x <=3D y); +} + +int +_islessgreater(double x, double y) +{ + if (isnan(x) || isnan(y)) + return 0; + + return ((x < y) || (x > y)); +} + +int +_isunordered(double x, double y) +{ + if (isnan(x) || isnan(y)) + return 1; + else + return 0; +} Index: lib/libc/gen/isinf.3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /u/cvs/cvs/src/lib/libc/gen/isinf.3,v retrieving revision 1.7 diff -u -r1.7 isinf.3 --- lib/libc/gen/isinf.3=0930 Oct 2000 13:23:18 -0000=091.7 +++ lib/libc/gen/isinf.3=098 Feb 2003 12:03:44 -0000 @@ -43,6 +43,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS +.In math.h .Ft int .Fn isinf double .Ft int Index: lib/msun/src/math.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /u/cvs/cvs/src/lib/msun/src/math.h,v retrieving revision 1.20 diff -u -r1.20 math.h --- lib/msun/src/math.h=0931 Oct 2002 23:05:20 -0000=091.20 +++ lib/msun/src/math.h=098 Feb 2003 12:03:49 -0000 @@ -27,6 +27,16 @@ #define HUGE_VAL=09(__infinity.__ud) /* + * C99 comparison macros + */ +#define isgreater(x,y) _isgreater(x,y) +#define isgreaterequal(x,y) _isgreaterequal(x,y) +#define isless(x,y) _isless(x,y) +#define islessequal(x,y) _islessequal(x,y) +#define islessgreater(x,y) _islessgreater(x,y) +#define isunordered(x,y) _isunordered(x,y) + +/* * XOPEN/SVID */ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) @@ -116,6 +126,14 @@ /* * ANSI/POSIX */ + +int _isgreater(double, double); +int _isgreaterequal(double, double); +int _isless(double, double); +int _islessequal(double, double); +int _islessgreater(double, double); +int _isunordered(double, double); + double=09acos(double); double=09asin(double); double=09atan(double); ---8<--- BTW, the SUSv3 text for isunordered() is b0rked, but that bug was already reported. best regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Feb 8 5:58:44 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 91C8F37B401 for ; Sat, 8 Feb 2003 05:58:36 -0800 (PST) Received: from thufir.bluecom.no (thufir.bluecom.no [217.118.32.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E22243F3F for ; Sat, 8 Feb 2003 05:58:35 -0800 (PST) (envelope-from eirik@eirikn.net) Received: from eirikn.net (a217-118-47-122.bluecom.no [217.118.47.122]) by thufir.bluecom.no (Postfix) with ESMTP id 7ADE450EC45 for ; Sat, 8 Feb 2003 14:58:27 +0100 (CET) Received: by eirikn.net (Postfix, from userid 1001) id 4FBC861; Sat, 8 Feb 2003 14:59:21 +0100 (CET) Date: Sat, 8 Feb 2003 14:59:21 +0100 From: Eirik Nygaard To: standards@FreeBSD.ORG Subject: strtof() Message-ID: <20030208135921.GA72899@eirikn.net> Mail-Followup-To: standards@FreeBSD.ORG Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V0207lvV8h4k8FAm" Content-Disposition: inline User-Agent: Mutt/1.5.3i 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 --V0207lvV8h4k8FAm Content-Type: multipart/mixed; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I tave made a strtof(3) function. Attached is the function, a small test program and the man page. I will also start on the strtold(3) now. --=20 Eirik Nygaard PGP Key: 83C55EDE --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="strtof.c" Content-Transfer-Encoding: quoted-printable /* * * Copyright (c) 2003 Eirik Nygaard * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPO= SE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTI= AL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI= CT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include float strtof(const char * __restrict nptr, char ** __restrict endptr) { char c; const char *s; float acc, decnum; int neg, any, dec, deccnt, a; =09 s =3D nptr; do { c =3D *s++; } while (isspace((unsigned char)c)); if (c =3D=3D '-') { neg =3D 1; c =3D *s++; } else { neg =3D 0; if (c =3D=3D '+') c =3D *s++; } =09 any =3D acc =3D dec =3D 0; for ( ; ; c =3D *s++) { if (c =3D=3D '.') { dec =3D 1; deccnt =3D 0; continue; } if (c >=3D '0' && c <=3D '9') c -=3D '0'; else break; any =3D 1; if (dec) { deccnt++; a =3D deccnt; decnum =3D c; for (; a > 0; a--) decnum /=3D 10; if ((FLT_MAX - decnum < acc) && !neg) { any =3D -1; break; } if ((FLT_MIN + decnum < acc) && neg) { any =3D -1; break; } else { if (neg) acc -=3D decnum; else acc +=3D decnum; } } else { any =3D 1; acc *=3D 10; if ((FLT_MAX - c < acc) && !neg) { any =3D -1; break; } if ((FLT_MIN + c < acc) && neg) { any =3D -1; break; } else { if (neg) acc -=3D c; else acc +=3D c; } } } if (any < 0) { acc =3D neg ? FLT_MIN : FLT_MAX; errno =3D ERANGE; } else if (!any) errno =3D EINVAL; =09 if (endptr !=3D NULL) *endptr =3D (char *)(any ? s - 1 : nptr); return (acc); } --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="strtof.3" .\" Copyright (c) 2003 Eirik Nygaard .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd February 8, 2003 .Dt STRTOF 3 .Os .Sh NAME .Nm strtof .Nd "convert a string value to a" .Vt float .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdlib.h .Ft float .Fn strtof "const char * restrict nptr" "char ** restrict endptr" .Sh DESCRIPTION The .Fn strtof function converts the string in .Fa nptr to a .Vt float value. .Pp The string may begin with an arbitrary amount of white space (as determined by .Xr isspace 3 ) followed by a single optional .Ql + or .Ql - sign. .Pp The remainder of the string is converted to a .Vt float value in the obvious manner, stopping at the first character which is not a valid digit. .Pp If .Fa endptr is not .Dv NULL , .Fn strtof stores the address of the first invalid character in .Fa *endptr . If there were no digits at all, however, .Fn strtof stores the original value of .Fa nptr in .Fa *endptr . (Thus, if .Fa *nptr is not .Ql \e0 but .Fa **endptr is .Ql \e0 on return, the entire string was valid.) .Sh RETURN VALUES The .Fn strtof , function return the result of the conversion, unless the value would underflow or overflow. If no conversion could be performed, 0 is returned and the global variable .Va errno is set to .Er EINVAL . If an overflow or underflow occurs, .Va errno is set to .Er ERANGE and the function return value is clamped according to the following table. .Bl -column -offset indent ".Fn strtoimax" ".Sy overflow" ".Sy underflow" .It Sy Function Ta Sy overflow Ta Sy underflow .It Fn strtof Ta Dv FLT_MIN Ta Dv FLT_MAX .El .Sh ERRORS .Bl -tag -width Er .It Bq Er EINVAL The value of .Fa base is not supported or no conversion could be performed. .It Bq Er ERANGE The given string was out of range; the value converted has been clamped. .El .Sh SEE ALSO .Xr atof 3 , .Xr atoi 3 , .Xr atol 3 , .Xr strtod 3 , .Xr strtoul 3 , .Xr strtol 3 , .Xr wcstol 3 .Sh STANDARDS The .Fn strtof function conform to .St -isoC-99 . --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mainstrtof.c" #include #include #include int main () { char *endp; float f; f = strtof("-5214.452", &endp); if (errno == ERANGE) printf("ERANGE\n"); else if (errno == EINVAL) printf("EINVAL\n"); else printf("It's a float with value %f\n", f); return 0; } --fUYQa+Pmc3FrFX/N-- --V0207lvV8h4k8FAm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+RQ041JB0Z4PFXt4RAkWrAJ4vFB2in8LMK96RwR0Dnx27Iow9pQCfYjmK jK1lrlDu/f+tSW4VlxBzAtM= =M8ed -----END PGP SIGNATURE----- --V0207lvV8h4k8FAm-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Feb 8 8:37:21 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 8CA1C37B405 for ; Sat, 8 Feb 2003 08:37:20 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id D91CA43FAF for ; Sat, 8 Feb 2003 08:37:18 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id DAA12442; Sun, 9 Feb 2003 03:36:53 +1100 Date: Sun, 9 Feb 2003 03:36:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Eirik Nygaard Cc: standards@FreeBSD.ORG Subject: Re: strtof() In-Reply-To: <20030208135921.GA72899@eirikn.net> Message-ID: <20030209022751.Q19037-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Sat, 8 Feb 2003, Eirik Nygaard wrote: > I tave made a strtof(3) function. > Attached is the function, a small test program and the man page. > I will also start on the strtold(3) now. This seems to be too simple to be correct. strtod() takes about 600 lines to do perfect (?) rounding, etc. Getting the last bit right is difficult. strtof() is already implemented by the same author as strtod(). See http://netlib.bell-labs.com/netlib/fp/index.html (file gdtoa.tar. See also dtoa.c for an up to date version of FreeBSD's strtod.c that has not been BSDified). Unfortunately, these files don't seem to be actively maintained (they haven't changed since I fetched them more than a year ago), and gdtoa seems to be missing any significant support for long doubles, and the differences between dtoa.c and FreeBSD's strtod.c are obfuscated by style "fixes" in the latter. I'm not sure of the state of support for C99 features like hex constants in dtoa.c. strtod.c seems to be missing even support for "INF" and "NAN" (we only changed the scanf family to support the C99 spelling of these). The scanf() family just uses strtod() to read floats. I think this sometimes gives rounding errors too (due to double rounding). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message 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 From owner-freebsd-standards Sat Feb 8 16:40:30 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 B26FD37B401 for ; Sat, 8 Feb 2003 16:40:29 -0800 (PST) Received: from mailbox.univie.ac.at (mailbox.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A41543F75 for ; Sat, 8 Feb 2003 16:40:28 -0800 (PST) (envelope-from l.ertl@univie.ac.at) Received: from adslle.cc.univie.ac.at (adslle.cc.univie.ac.at [131.130.102.11]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h190eHt3223056; Sun, 9 Feb 2003 01:40:21 +0100 Date: Sun, 9 Feb 2003 01:40:17 +0100 (CET) From: Lukas Ertl To: David Schultz Cc: standards@FreeBSD.ORG Subject: Re: C99 floating point macros In-Reply-To: <20030209003350.GA20683@HAL9000.homeunix.com> Message-ID: <20030209013955.U355@leelou.in.tern> References: <20030207194848.N353@leelou.in.tern> <20030208112619.GA15718@HAL9000.homeunix.com> <20030208130529.C355@leelou.in.tern> <20030209003350.GA20683@HAL9000.homeunix.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: mx1 4261; Body=2 Fuz1=2 Fuz2=2 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 On Sat, 8 Feb 2003, David Schultz wrote: > Hmm...why not just use some macros, like this? > > #define=09isgreater(x, y)=09=09(!isunordered((x), (y)) && (x) > (y)) > #define=09isgreaterequal(x, y)=09(!isunordered((x), (y)) && (x) >=3D (y)) > #define=09isless(x, y)=09=09(!isunordered((x), (y)) && (x) < (y)) > #define=09islessequal(x, y)=09(!isunordered((x), (y)) && (x) <=3D (y)) > #define=09islessgreater(x, y)=09(!isunordered((x), (y)) && \ > =09=09=09=09=09((x) > (y) || (y) > (x))) > #define=09isunordered(x, y)=09(isnan(x) || isnan(y)) Ok, this is a whole lot simpler :-) regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message