Page MenuHomeFreeBSD

fmax.3: Add caveat for going beyond C std requirements
ClosedPublic

Authored by emaste on Apr 2 2026, 10:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 27, 3:36 PM
Unknown Object (File)
Mon, Apr 27, 1:56 PM
Unknown Object (File)
Sat, Apr 25, 9:28 AM
Unknown Object (File)
Sat, Apr 18, 11:46 AM
Unknown Object (File)
Sat, Apr 18, 10:56 AM
Unknown Object (File)
Sat, Apr 18, 1:06 AM
Unknown Object (File)
Thu, Apr 16, 8:32 AM
Unknown Object (File)
Thu, Apr 16, 7:40 AM

Details

Summary
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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

fuz added a subscriber: jesuscblazquez_gmail.com.

Once we get fmaximum_num and fminimum_num in, we should recommend that those be used instead. CC @jesuscblazquez_gmail.com.

This revision is now accepted and ready to land.Apr 2 2026, 10:11 PM