]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
math: Add long double constant definitions
authorCollin Funk <collin.funk1@gmail.com>
Fri, 12 Apr 2024 17:12:59 +0000 (11:12 -0600)
committerWarner Losh <imp@FreeBSD.org>
Fri, 12 Apr 2024 18:30:58 +0000 (12:30 -0600)
commit22ddb5bb83a2c963821c96317318389d07300d2e
tree6547d8c135a6414b8a8dcbcc6f70764dcbdfd3a2
parent6c3e01bf8578de54abc019832d799de80da7378c
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 <collin.funk1@gmail.com>
Reviewed by: imp, allanjude
Pull Request: https://github.com/freebsd/freebsd-src/pull/1121
lib/msun/src/math.h