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)
Sat, Sep 26, 1:16 AM
Unknown Object (File)
Wed, Sep 23, 7:33 PM
Unknown Object (File)
Wed, Sep 23, 12:30 PM
Unknown Object (File)
Tue, Sep 22, 3:17 PM
Unknown Object (File)
Sat, Sep 19, 11:53 PM
Unknown Object (File)
Fri, Sep 11, 2:55 AM
Unknown Object (File)
Thu, Sep 3, 11:34 PM
Unknown Object (File)
Tue, Sep 1, 7:38 PM

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