diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2026-04-02 21:59:42 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2026-04-06 17:00:15 +0000 |
| commit | 7764e9ca28a9702aed4ba7391e055ec2fcf35c41 (patch) | |
| tree | 4aebf39f1c62b300ccfe720607504963b50a03a7 | |
| parent | e6db4dd9d7216067388ae91ac73c3917a93f9420 (diff) | |
fmax.3: Add caveat for going beyond C std requirements
libm's fmax and fmin family of functions treat +0.0 as greater than
-0.0. This is not required by the C standard, so the user may not see
this behaviour due to compiler optimization.
PR: 294214
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56230
| -rw-r--r-- | lib/msun/man/fmax.3 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/msun/man/fmax.3 b/lib/msun/man/fmax.3 index 25fc9b6d518a..873a19375ce5 100644 --- a/lib/msun/man/fmax.3 +++ b/lib/msun/man/fmax.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 29, 2004 +.Dd April 6, 2026 .Dt FMAX 3 .Os .Sh NAME @@ -68,10 +68,6 @@ functions return the smaller of .Fa x and .Fa y . -They treat -.Li +0.0 -as being larger than -.Li -0.0 . If one argument is an \*(Na, then the other argument is returned. If both arguments are \*(Nas, then the result is an \*(Na. These routines do not raise any floating-point exceptions. @@ -90,6 +86,13 @@ and .Fn fminl functions conform to .St -isoC-99 . +.Sh CAVEATS +The library implementations of these functions treat +.Li +0.0 +as being larger than +.Li -0.0 . +This behavior is not specified by the C standard, is not portable, +and may not occur in light of compiler optimizations. .Sh HISTORY These routines first appeared in .Fx 5.3 . |
