FMAX(3P)

πŸ’– FMAX(3P) πŸ’–

okay bestie, welcome to the POSIX Programmer's Manual β€” this one's FMAX(3P) and it's literally about picking the bigger of two floats. the whole PROLOG situation is this: this manual page is part of the POSIX Programmer's Manual, and the Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. so like, vibe check your platform first, no cap. 🫢


✨ NAME ✨

fmax, fmaxf, fmaxl β€” determine maximum numeric value of two floating-point numbers

that's it, that's the whole job. queen behaviour honestly πŸ‘‘


🌸 SYNOPSIS 🌸

#include <math.h>

double fmax(double x, double y);
float fmaxf(float x, float y);
long double fmaxl(long double x, long double y);

three flavours, same energy β€” double, float, and long double. pick your precision, bestie πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the tea is: the functionality described on this reference page is aligned with the ISO C standard. and like, any conflict between the requirements described here and the ISO C standard is unintentional β€” this volume of POSIX.1‐2017 defers to the ISO C standard. so if they ever beef, ISO C wins, periodt.

these functions shall determine the maximum numeric value of their arguments.

and here's the iconic part: NaN arguments shall be treated as missing data. so if one argument is a NaN and the other is numeric, then these functions shall choose the numeric value. yes bestie, it's giving "not me, not today" to the NaN β€” it just quietly ignores it and hands you the real number. 🌈


πŸ’œ RETURN VALUE πŸ’œ

upon successful completion, these functions shall return the maximum numeric value of their arguments.

  • if just one argument is a NaN, the other argument shall be returned.
  • if x and y are NaN, a NaN shall be returned.

so: one NaN = you still get a real answer πŸŽ€. two NaNs = you get NaN back, which is honestly fair, you gave it nothing to work with 😭.


πŸ”₯ ERRORS πŸ”₯

no errors are defined. zero. none. nothing to worry about, bestie 🧚

the following sections are informative β€” aka the bonus lore ✨


🌟 EXAMPLES 🌟

None.

(it said what it said πŸ’€)


πŸŽ€ APPLICATION USAGE πŸŽ€

None.


🌈 RATIONALE 🌈

None.


⭐ FUTURE DIRECTIONS ⭐

None.


πŸ‘‘ SEE ALSO πŸ‘‘

  • fdim()
  • fmin()
  • The Base Definitions volume of POSIX.1‐2017, <math.h>

go read those too, they're the friend group 🫢


okay this part is the serious one so listen up, no skipping:

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .

fr fr β€” if this page and the actual Standard ever disagree, the Standard is the main character, not this page. πŸ’…

that's the whole thing bestie, you ate it up πŸ’– this little love letter came to you from IEEE/The Open Group, 2017 β€” stay slay, go pick the bigger float 🌸✨

πŸ“¦ where this page comes from