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