From nobody Fri Apr 12 18:33:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VGQDJ2ld6z5Hrtn; Fri, 12 Apr 2024 18:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VGQDJ226qz4J1J; Fri, 12 Apr 2024 18:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712946784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hriYcpkGk+kuhzdl6hDaNIa7MDk3JgsXqUjBwdA/lGQ=; b=ltmGs6xHXsuO3M2ujVPwVIUbMcNggTW3/ntuGLSoADy8ETXQRtgTGGLnWMhCYLohieWC4c WBP82tQoTudNeweygMXSwdtcyBKCNisVmRjOVSBsqEUvTMJNXee/P0Kp70cf92w/cakjhV YcbIYk8xIAkmBo5s9ZcRscxjpuBO3DaDnVLXlVr7XIBC7onE79V5ShnyXxyzjBCrf39oBD IZAYWFzT/9kq+G3Af7MggOGhJta+k4Id44U4NZgNkNpe/oRhp8b/UgbosmzRhCT/raCYKR jC/Qnpr87lCkgFzFAwb7bFRVjny5PASYi3yjTdbalsrNpKW+1LpXP5HG+5zhig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712946784; a=rsa-sha256; cv=none; b=OsW3tHH4LdsFVpwlWKYLxAtDjOG5M4TkoIRLLYDIQeVhYY4yMahsKxKpduacg2EwMCvRcU BYmzZAaDjGL71/SYEJnW1RjAMzQp68IvGGqlb+ByETYc05M5WCyExi3ki9HnzemzRlefST +4wXdgm24nxFXAJDz/DmfgVC/Pb3w2a8adxR1cnWDTosgHl52xCY4sNqByFv9vAdc4Zpbs 4WK2ujrKdcJeQKdFMSaT7OUcKm2mkxQK1PFEm//eMwz0+fPsjRTYNY6mUZ9aNsXNMnFO1I Y1Jm1OTinUh5lshv6b/A1o1xAZtTNE5GeExaSWIZfzixcEVD0WtvEWLJsachqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712946784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hriYcpkGk+kuhzdl6hDaNIa7MDk3JgsXqUjBwdA/lGQ=; b=UpnzUhqi+irhEevAM3Az5RcZqniXGVmk5S8O8r3+LUmIxO3JOgZM9ETrcxYf6kVZvvCwe4 F8OmAxfnvke+L+rnBuTheRy0KazmBhbi8ldAJExuxvLg+MQ9yj8IpSD6L9IuEcui+TxFWw j0Yogs6oMbx/fEDxcyXm5VmFUqoQq+PiRvIbJ2SrtGWBJ8iayikpzQOFaWoC1hkda1pgRe xzj/0cl5dg4HXevdKIBMvwCecsYwl36qwiFH5RHr0dGcLjn9yIorL6QWCoKjyyfnECaIwW kc7ryyO5GgggxYM/wPiOyhLANFSc1F8IFimb8z9+xWBFDXyS9Mue1srBpZ7HMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VGQDJ1dLDz10hl; Fri, 12 Apr 2024 18:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CIX4GT010781; Fri, 12 Apr 2024 18:33:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CIX4WT010778; Fri, 12 Apr 2024 18:33:04 GMT (envelope-from git) Date: Fri, 12 Apr 2024 18:33:04 GMT Message-Id: <202404121833.43CIX4WT010778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 22ddb5bb83a2 - main - math: Add long double constant definitions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22ddb5bb83a2c963821c96317318389d07300d2e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=22ddb5bb83a2c963821c96317318389d07300d2e commit 22ddb5bb83a2c963821c96317318389d07300d2e Author: Collin Funk AuthorDate: 2024-04-12 17:12:59 +0000 Commit: Warner Losh CommitDate: 2024-04-12 18:30:58 +0000 math: Add long double constant definitions These constants are GNU libc extensions that are likely to be adopted by the next POSIX revision [1]. The definitions can be verified in a PARI-GP shell session: * M_El: exp (1) * M_LOG2El: log (exp (1)) / log (2) * M_LOG10El: log (exp (1)) / log (10) * M_LN2l: log (2) * M_LN10l: log (10) * M_PIl: Pi * M_PI_2l: Pi / 2 * M_PI_4l: Pi / 4 * M_1_PIl: 1 / Pi * M_2_PIl: 2 / Pi * M_2_SQRTPIl: 2 / sqrt (Pi) * M_SQRT2l: sqrt (2) * M_SQRT1_2l: 1 / sqrt (2) [1] https://austingroupbugs.net/view.php?id=828 Put these behind __BSD_VISIBLE || __XSI_VISIBLE >= 800 to future-proof these changes. They shouldn't be defined at lower levels of XSI, but don't have other XSI 800 stuff in place yet. Signed-off-by: Collin Funk Reviewed by: imp, allanjude Pull Request: https://github.com/freebsd/freebsd-src/pull/1121 --- lib/msun/src/math.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index 5fc359ead158..0abf4b605fb8 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -142,6 +142,22 @@ typedef __float_t float_t; #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ +#if __BSD_VISIBLE || __XSI_VISIBLE >= 800 +#define M_El 2.718281828459045235360287471352662498L /* e */ +#define M_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */ +#define M_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */ +#define M_LN2l 0.693147180559945309417232121458176568L /* log_e 2 */ +#define M_LN10l 2.302585092994045684017991454684364208L /* log_e 10 */ +#define M_PIl 3.141592653589793238462643383279502884L /* pi */ +#define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ +#define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ +#define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ +#define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ +#define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ +#define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ +#define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ +#endif /* __BSD_VISIBLE || __XSI_VISIBLE >= 800 */ + #define MAXFLOAT ((float)3.40282346638528860e+38) extern int signgam; #endif /* __BSD_VISIBLE || __XSI_VISIBLE */