From owner-freebsd-standards Thu Mar 14 10:53:58 2002 Delivered-To: freebsd-standards@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id A1E7437B404 for ; Thu, 14 Mar 2002 10:53:56 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.11.4/8.11.6) id g2EIrt385522; Thu, 14 Mar 2002 13:53:55 -0500 (EST) (envelope-from wollman) Date: Thu, 14 Mar 2002 13:53:55 -0500 (EST) From: Garrett Wollman Message-Id: <200203141853.g2EIrt385522@khavrinen.lcs.mit.edu> To: standards@FreeBSD.org Subject: Floating-point conversions 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 assume everyone is aware of ? I think David Gay's `gdtoa.tgz' package may be of particular interest, since we do not presently support `long double' particularly well on any platform, and would need something like this for printf "%Lf"-like formats. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Mar 14 11:10:35 2002 Delivered-To: freebsd-standards@freebsd.org Received: from columbus.cris.net (columbus.cris.net [212.110.128.65]) by hub.freebsd.org (Postfix) with ESMTP id B7D8E37B445 for ; Thu, 14 Mar 2002 11:10:22 -0800 (PST) Received: from ark.cris.net (root@ns2.cris.net [212.110.128.68]) by columbus.cris.net (8.9.3/8.9.3) with ESMTP id VAA48333; Thu, 14 Mar 2002 21:10:16 +0200 (EET) Received: (from phantom@localhost) by ark.cris.net (8.11.1/8.11.1) id g2EJAGn86676; Thu, 14 Mar 2002 21:10:16 +0200 (EET) Date: Thu, 14 Mar 2002 21:10:16 +0200 From: Alexey Zelkin To: Garrett Wollman Cc: standards@FreeBSD.ORG Subject: Re: Floating-point conversions Message-ID: <20020314211016.B85834@ark.cris.net> References: <200203141853.g2EIrt385522@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200203141853.g2EIrt385522@khavrinen.lcs.mit.edu>; from wollman@lcs.mit.edu on Thu, Mar 14, 2002 at 01:53:55PM -0500 X-Operating-System: FreeBSD 3.5-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 On Thu, Mar 14, 2002 at 01:53:55PM -0500, Garrett Wollman wrote: > I assume everyone is aware of ? I think > David Gay's `gdtoa.tgz' package may be of particular interest, since > we do not presently support `long double' particularly well on any > platform, and would need something like this for printf "%Lf"-like > formats. Yes. I have made some initial review of this package. It provides much better support for many things. But I don't think that whole package will be useful for FreeBSD. Unfortunatelly I still not have a time to dig into this package and prepare it to import to FreeBSD. :-( To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Mar 14 11:43:42 2002 Delivered-To: freebsd-standards@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 83DE937B400 for ; Thu, 14 Mar 2002 11:43:39 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g2EJhci38276; Thu, 14 Mar 2002 12:43:38 -0700 (MST) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g2EJhbL51644; Thu, 14 Mar 2002 12:43:37 -0700 (MST) (envelope-from imp@village.org) Date: Thu, 14 Mar 2002 12:43:27 -0700 (MST) Message-Id: <20020314.124327.57443458.imp@village.org> To: wollman@lcs.mit.edu Cc: standards@FreeBSD.ORG Subject: Re: Floating-point conversions From: "M. Warner Losh" In-Reply-To: <200203141853.g2EIrt385522@khavrinen.lcs.mit.edu> References: <200203141853.g2EIrt385522@khavrinen.lcs.mit.edu> X-Mailer: Mew version 2.1 on Emacs 21.1 / 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: <200203141853.g2EIrt385522@khavrinen.lcs.mit.edu> Garrett Wollman writes: : I assume everyone is aware of ? I think : David Gay's `gdtoa.tgz' package may be of particular interest, since : we do not presently support `long double' particularly well on any : platform, and would need something like this for printf "%Lf"-like : formats. NetBSD has code to support the long double printfs when the magnitude of the long double exceeds what can be represented in a double. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Mar 14 11:44:38 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id D031837B402 for ; Thu, 14 Mar 2002 11:44:34 -0800 (PST) Received: from isi.com ([128.224.195.173]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id LAA22445 for ; Thu, 14 Mar 2002 11:44:10 -0800 (PST) Message-ID: <3C90FDA0.E7280635@isi.com> Date: Thu, 14 Mar 2002 14:44:32 -0500 From: Tadayuki OKADA Organization: Wind River X-Mailer: Mozilla 4.79C-ja [ja_JP.EUC] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en, ja MIME-Version: 1.0 To: standards@FreeBSD.org Subject: _MULTI_LIBM 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 Hello, Why is FreeBSD's mathlib compiled with -D_IEEE_LIBM, not -D_MULTI_LIBM? It's not POSIX complient nor ANSI. Regards, -- Tadayuki OKADA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Mar 14 12:47:43 2002 Delivered-To: freebsd-standards@freebsd.org Received: from columbus.cris.net (columbus.cris.net [212.110.128.65]) by hub.freebsd.org (Postfix) with ESMTP id 27F6A37B417; Thu, 14 Mar 2002 12:47:32 -0800 (PST) Received: from ark.cris.net (root@ns2.cris.net [212.110.128.68]) by columbus.cris.net (8.9.3/8.9.3) with ESMTP id WAA56588; Thu, 14 Mar 2002 22:03:51 +0200 (EET) Received: (from phantom@localhost) by ark.cris.net (8.11.1/8.11.1) id g2EK3p993401; Thu, 14 Mar 2002 22:03:51 +0200 (EET) Date: Thu, 14 Mar 2002 22:03:51 +0200 From: Alexey Zelkin To: Tadayuki OKADA Cc: standards@FreeBSD.ORG, bde@FreeBSD.ORG Subject: Re: _MULTI_LIBM Message-ID: <20020314220351.A93251@ark.cris.net> References: <3C90FDA0.E7280635@isi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3C90FDA0.E7280635@isi.com>; from tokada@isi.com on Thu, Mar 14, 2002 at 02:44:32PM -0500 X-Operating-System: FreeBSD 3.5-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 hi, Actually -D_MULTI_LIBM is no-op. :-( Also I'd suggest to ask Bruce [Cc'ed] for this since he's most expirienced person to answer to this question. On Thu, Mar 14, 2002 at 02:44:32PM -0500, Tadayuki OKADA wrote: > Hello, > > Why is FreeBSD's mathlib compiled with -D_IEEE_LIBM, > not -D_MULTI_LIBM? > > It's not POSIX complient nor ANSI. > > Regards, > -- > Tadayuki OKADA > > 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 Thu Mar 14 12:54:23 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id 0810637B425; Thu, 14 Mar 2002 12:54:06 -0800 (PST) Received: from windriver.com ([128.224.195.173]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id MAA11812; Thu, 14 Mar 2002 12:53:17 -0800 (PST) Message-ID: <3C910DD3.33CDB47C@windriver.com> Date: Thu, 14 Mar 2002 15:53:39 -0500 From: Tadayuki OKADA Organization: Wind River X-Mailer: Mozilla 4.79C-ja [ja_JP.EUC] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en, ja MIME-Version: 1.0 To: Alexey Zelkin Cc: Tadayuki OKADA , standards@freebsd.org, bde@freebsd.org Subject: Re: _MULTI_LIBM References: <3C90FDA0.E7280635@isi.com> <20020314220351.A93251@ark.cris.net> 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 Hi, Alexey Zelkin wrote: > Actually -D_MULTI_LIBM is no-op. :-( Yeah, right. But if we don't use -D_IEEE_LIBM, it'll be multi-libm. > Also I'd suggest to ask Bruce [Cc'ed] for this since he's > most expirienced person to answer to this question. > > On Thu, Mar 14, 2002 at 02:44:32PM -0500, Tadayuki OKADA wrote: > > Hello, > > > > Why is FreeBSD's mathlib compiled with -D_IEEE_LIBM, > > not -D_MULTI_LIBM? > > > > It's not POSIX complient nor ANSI. -- Tadayuki OKADA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Mar 14 15:19:36 2002 Delivered-To: freebsd-standards@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 5F76437B417 for ; Thu, 14 Mar 2002 15:19:34 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.11.4/8.11.6) id g2ENJV888084; Thu, 14 Mar 2002 18:19:31 -0500 (EST) (envelope-from wollman) Date: Thu, 14 Mar 2002 18:19:31 -0500 (EST) From: Garrett Wollman Message-Id: <200203142319.g2ENJV888084@khavrinen.lcs.mit.edu> To: "M. Warner Losh" Cc: standards@FreeBSD.ORG Subject: Re: Floating-point conversions In-Reply-To: <20020314.124327.57443458.imp@village.org> References: <200203141853.g2EIrt385522@khavrinen.lcs.mit.edu> <20020314.124327.57443458.imp@village.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 < said: > NetBSD has code to support the long double printfs when the magnitude > of the long double exceeds what can be represented in a double. The nice feature of David Gay's code is that (a) it's from the same guy who did our existing __dtoa() implementation, and (b) it not only implements all of the possible `long double' formats that we might need (e.g., Intel 80-bit extended-double-precision, Sun 128-bit quad-precision) but also implements some other formats which -- though not standardized -- might be useful to make available as a ready-made solution for certain kinds of applications. This library supports the following formats: f IEEE single precision d IEEE double precision x IEEE extended precision, as on Intel 80x87 and software emulations of Motorola 68xxx chips that do not pad the way the 68xxx does, but only store 80 bits xL IEEE extended precision, as on Motorola 68xxx chips Q quad precision, as on Sun Sparc chips dd double double, pairs of IEEE double numbers whose sum is the desired value The additional strto* functions are all simple wrappers around the underlying core library, and are in reserved namespace so we're safe making them available in libc. The license is BSD-compatible. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Mar 14 20:52:14 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id F12B237B400 for ; Thu, 14 Mar 2002 20:52:07 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id PAA13165; Fri, 15 Mar 2002 15:51:51 +1100 Date: Fri, 15 Mar 2002 15:53:22 +1100 (EST) From: Bruce Evans X-X-Sender: To: Tadayuki OKADA Cc: Subject: Re: _MULTI_LIBM In-Reply-To: <3C90FDA0.E7280635@isi.com> Message-ID: <20020315153546.N22775-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 Thu, 14 Mar 2002, Tadayuki OKADA wrote: > Why is FreeBSD's mathlib compiled with -D_IEEE_LIBM, > not -D_MULTI_LIBM? Partly for historical reasons: # RCS file: /home/ncvs/src/lib/msun/Makefile,v # Working file: Makefile # head: 1.28 # ... # ---------------------------- # revision 1.12 # date: 1997/01/08 13:22:28; author: wollman; state: Exp; lines: +2 -2 # Delete -D_POSIX_MODE and -D_MULTI_LIBM from CFLAGS. They never had any effect # because _IEEE_LIBM always takes priority, so the definition just served # to confuse. # # Reviewed by: bde # ---------------------------- No one complained (at least loadly) about this, so the feature obviously wasn't missed much. Partly because _POSIX_MODE is incompletely and poorly implemented: - most functions don't set errno as specified in C90. - error handling usually degrades IEEE754'ness by replacing NaNs or perhaps even Infs by normal numbers. Partly because compiling with _MULTI_LIBM pessimizes all modes. > It's not POSIX complient nor ANSI. It is now :-). C99 supports IEEE754, and doesn't require math functions to set errno. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Mar 15 12:46:25 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id 1DAA737B404 for ; Fri, 15 Mar 2002 12:44:28 -0800 (PST) Received: from windriver.com (IDENT:root@pburas.epilogue.com [128.224.4.10]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id MAA16585; Fri, 15 Mar 2002 12:43:53 -0800 (PST) Message-ID: <3C925E7E.308508E@windriver.com> Date: Fri, 15 Mar 2002 15:50:06 -0500 From: Tadayuki OKADA X-Mailer: Mozilla 4.79C-ja [ja_JP.EUC] (X11; U; Linux 2.4.2 i386) X-Accept-Language: ja, en MIME-Version: 1.0 To: Bruce Evans Cc: Tadayuki OKADA , standards@freebsd.org Subject: Re: _MULTI_LIBM References: <20020315153546.N22775-100000@gamplex.bde.org> 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 Bruce Evans wrote: > > It's not POSIX complient nor ANSI. > > It is now :-). C99 supports IEEE754, and doesn't require math functions > to set errno. In this respect, yes. But other portion of FreeBSD is not (yet), so we can't say FreeBSD is C90 complient or C99. BTW, why don't we just define math_errhandling, MATH_ERRNO and MATH_ERREXCEPT in math.h for POSIX complience for now? Or are we waiting for fenv.h? Regards, -- Tadayuki OKADA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Mar 15 15:56:24 2002 Delivered-To: freebsd-standards@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id E21FA37B420 for ; Fri, 15 Mar 2002 15:55:59 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.11.4/8.11.6) id g2FNtvi99977; Fri, 15 Mar 2002 18:55:57 -0500 (EST) (envelope-from wollman) Date: Fri, 15 Mar 2002 18:55:57 -0500 (EST) From: Garrett Wollman Message-Id: <200203152355.g2FNtvi99977@khavrinen.lcs.mit.edu> To: Tadayuki OKADA Cc: standards@FreeBSD.ORG Subject: Re: _MULTI_LIBM In-Reply-To: <3C925E7E.308508E@windriver.com> References: <20020315153546.N22775-100000@gamplex.bde.org> <3C925E7E.308508E@windriver.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 < said: > In this respect, yes. But other portion of FreeBSD is not (yet), > so we can't say FreeBSD is C90 complient or C99. Our goal is to come as close as we can to POSIX 2001. We will never meet the restrictions of old versions of POSIX or ISO C, for many reasons, most of which are features and not bugs. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Mar 16 5:43:32 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id F1C0B37B400 for ; Sat, 16 Mar 2002 05:43:24 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA02427; Sun, 17 Mar 2002 00:43:06 +1100 Date: Sun, 17 Mar 2002 00:44:43 +1100 (EST) From: Bruce Evans X-X-Sender: To: Tadayuki OKADA Cc: Tadayuki OKADA , Subject: Re: _MULTI_LIBM In-Reply-To: <3C922061.DD01E0B@windriver.com> Message-ID: <20020317001529.T30317-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, 15 Mar 2002, Tadayuki OKADA wrote: > Bruce Evans wrote: > > > It's not POSIX complient nor ANSI. > > > > It is now :-). C99 supports IEEE754, and doesn't require math functions > > to set errno. > In this respect, yes. But other portion of FreeBSD is not (yet), > so we can't say FreeBSD is C90 complient or C99. > > BTW, why don't we just define math_errhandling, MATH_ERRNO and > MATH_ERREXCEPT in math.h for POSIX complience for now? > Or are we waiting for fenv.h? I didn't know about math_errhandling, MATH_ERRNO or MATH_ERREXCEPT. They seem to be new in POSIX.1-2001 (they aren't in POSIX-1.1996 or C99). math_errhandling seems to be settable by the implemenation only. They are bugs in POSIX IMO. C99 got rid of the broken-as-designed requirement to set errno, but POSIX increased it (in practice). From POSIX-1.200x-draft7: 3861 APPLICATION USAGE 3862 On error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling & 3863 MATH_ERREXCEPT) are independent of each other, but at least one of them must be non-zero. I'm not sure if the application can set math_handling. So, POSIX now gives the alternatives of MATH_ERRNO being set (this means that math functions must set errno for all types if "errors" (not just for range errors as required by C90)), or MATH_ERREXCEPT being set (this means that math functions must cause exceptions as not permitted by C9*, but as FreeBSD on i386's used to do). I'm certainly waiting for fenv.h :-). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Mar 16 14:35:29 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id E78D537B402 for ; Sat, 16 Mar 2002 14:35:25 -0800 (PST) Received: from windriver.com (IDENT:root@pburas.epilogue.com [128.224.4.10]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id OAA18165; Sat, 16 Mar 2002 14:34:55 -0800 (PST) Message-ID: <3C93C9C5.F085857A@windriver.com> Date: Sat, 16 Mar 2002 17:40:05 -0500 From: Tadayuki OKADA X-Mailer: Mozilla 4.79C-ja [ja_JP.EUC] (X11; U; Linux 2.4.2 i386) X-Accept-Language: ja, en MIME-Version: 1.0 To: Bruce Evans Cc: Tadayuki OKADA , standards@freebsd.org Subject: Re: _MULTI_LIBM References: <20020317001529.T30317-100000@gamplex.bde.org> 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 Bruce Evans wrote: > > BTW, why don't we just define math_errhandling, MATH_ERRNO and > > MATH_ERREXCEPT in math.h for POSIX complience for now? > > Or are we waiting for fenv.h? > > I didn't know about math_errhandling, MATH_ERRNO or MATH_ERREXCEPT. > They seem to be new in POSIX.1-2001 (they aren't in POSIX-1.1996 or > C99). math_errhandling seems to be settable by the implemenation only. from POSIX.1-2001 Base Definitions Chapter13 Headers : The following macros shall expand to the integer constants 1 and 2, respectively; MATH_ERRNO MATH_ERREXCEPT The following macro shall expand to an expression that has type int and the value MATH_ERRNO, MATH_ERREXCEPT, or the bitwise-inclusive OR of both: math_errhandling The value of math_errhandling is constant for the duration of the program. It is unspecified whether math_errhandling is a macro or an identifier with external linkage. If a macro definition is suppressed or a program defines an identifier with the name math_errhandling , the behavior is undefined. If the expression (math_errhandling & MATH_ERREXCEPT) can be non-zero, the implementation shall define the macros FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in . > They are bugs in POSIX IMO. C99 got rid of the broken-as-designed > requirement to set errno, but POSIX increased it (in practice). No, new POSIX just requires one of 'errno' or 'exception' error handling must be present. You don't need to set 'errno', but then you have to have exception handling defined in . I don't know if C99 mandates one of them to be present. > I'm not sure if the application can set math_handling. I think it can't. See quotation above. > or MATH_ERREXCEPT being set (this means that math functions > must cause exceptions as not permitted by C9*, but as FreeBSD > on i386's used to do). MATH_ERREXCEPT means you can use fp-exception facility defined in , so it's not inconsistent with C99. Regards, -- Tadayuki OKADA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Mar 16 17:23: 1 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 6A6EE37B417 for ; Sat, 16 Mar 2002 17:22:57 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id MAA01698; Sun, 17 Mar 2002 12:22:49 +1100 Date: Sun, 17 Mar 2002 12:24:25 +1100 (EST) From: Bruce Evans X-X-Sender: To: Tadayuki OKADA Cc: Tadayuki OKADA , Subject: Re: _MULTI_LIBM In-Reply-To: <3C93C9C5.F085857A@windriver.com> Message-ID: <20020317113138.E34997-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, 16 Mar 2002, Tadayuki OKADA wrote: > Bruce Evans wrote: > > > BTW, why don't we just define math_errhandling, MATH_ERRNO and > > > MATH_ERREXCEPT in math.h for POSIX complience for now? > > > Or are we waiting for fenv.h? > ... > > They are bugs in POSIX IMO. C99 got rid of the broken-as-designed > > requirement to set errno, but POSIX increased it (in practice). > No, new POSIX just requires one of 'errno' or 'exception' error handling > must be present. You don't need to set 'errno', but then you have to > have exception handling defined in . > I don't know if C99 mandates one of them to be present. C99 permits both but requires neither. Also, it specifies "exceptions" more clearly -- math errors may raise exceptions by just setting an exception flag; a SIGFPE for this is permitted but not required. There is no standard way to tell if you will get SIGFPE's. I think POSIX intends to say the same, but I couldn't find where it connects "floating-point exception" with "SIGFPE". > > or MATH_ERREXCEPT being set (this means that math functions > > must cause exceptions as not permitted by C9*, but as FreeBSD > > on i386's used to do). > MATH_ERREXCEPT means you can use fp-exception facility > defined in , so it's not inconsistent with C99. OK. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Mar 16 18:22: 5 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id 9D2BE37B402 for ; Sat, 16 Mar 2002 18:22:03 -0800 (PST) Received: from windriver.com (IDENT:root@pburas.epilogue.com [128.224.4.10]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id SAA29586; Sat, 16 Mar 2002 18:21:33 -0800 (PST) Message-ID: <3C93FEDB.5179AAE5@windriver.com> Date: Sat, 16 Mar 2002 21:26:35 -0500 From: Tadayuki OKADA X-Mailer: Mozilla 4.79C-ja [ja_JP.EUC] (X11; U; Linux 2.4.2 i386) X-Accept-Language: ja, en MIME-Version: 1.0 To: Bruce Evans Cc: Tadayuki OKADA , standards@freebsd.org Subject: Re: _MULTI_LIBM References: <20020317113138.E34997-100000@gamplex.bde.org> 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 Bruce Evans wrote: > C99 permits both but requires neither. Also, it specifies "exceptions" > more clearly -- math errors may raise exceptions by just setting an > exception flag; a SIGFPE for this is permitted but not required. There > is no standard way to tell if you will get SIGFPE's. I think POSIX > intends to say the same, but I couldn't find where it connects > "floating-point exception" with "SIGFPE". There's a table describing the reason of signals. from POSIX.1-2001 Base Definitions Chapter13 Headers : SIGFPE FPE_INTDIV Integer divide by zero. FPE_INTOVF Integer overflow. FPE_FLTDIV Floating-point divide by zero. FPE_FLTOVF Floating-point overflow. FPE_FLTUND Floating-point underflow. FPE_FLTRES Floating-point inexact result. FPE_FLTINV Invalid floating-point operation. FPE_FLTSUB Subscript out of range. Regards, -- Tadayuki OKADA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Mar 16 19:46:11 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id 4A47037B404 for ; Sat, 16 Mar 2002 19:46:10 -0800 (PST) Received: from windriver.com (IDENT:root@pburas.epilogue.com [128.224.4.10]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id TAA14022; Sat, 16 Mar 2002 19:45:36 -0800 (PST) Message-ID: <3C94128E.8578BF27@windriver.com> Date: Sat, 16 Mar 2002 22:50:38 -0500 From: Tadayuki OKADA X-Mailer: Mozilla 4.79C-ja [ja_JP.EUC] (X11; U; Linux 2.4.2 i386) X-Accept-Language: ja, en MIME-Version: 1.0 To: Bruce Evans Cc: Tadayuki OKADA , standards@freebsd.org Subject: Re: _MULTI_LIBM References: <20020317113138.E34997-100000@gamplex.bde.org> 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 Bruce Evans wrote: > > No, new POSIX just requires one of 'errno' or 'exception' error handling > > must be present. You don't need to set 'errno', but then you have to > > have exception handling defined in . > > I don't know if C99 mandates one of them to be present. > > C99 permits both but requires neither. I didn't know, but it seems C99 requires same. See ISO/IEC 9899:1999 $7.12 - pp213. One of 'errno' or 'exception' must be present for C99 complience. Regards, -- Tadayuki OKADA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message