FMIN(3POSIX)

✨ PROLOG ✨

okay bestie, real talk before we get into it πŸ’– this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, pls go consult the corresponding Linux manual page for the deets on Linux behavior), or β€” and this is the messy part β€” the interface may not even be implemented on Linux at all. πŸ™ˆ no cap.


πŸ’… NAME πŸ’…

fmin, fminf, fminl β€” determine minimum numeric value of two floating-point numbers

so like, it's giving "which of u two is smaller" but for floats. icon behavior.


🌸 SYNOPSIS 🌸

#include <math.h>

double fmin(double x, double y);
float fminf(float x, float y);
long double fminl(long double x, long double y);

three versions, one vibe: double, float, long double. pick ur fighter. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional β€” like, not on purpose, we promise 😭. This volume of POSIX.1‐2017 defers to the ISO C standard.

These functions shall determine the minimum numeric value of their arguments.

and here's the ✨main character✨ plot twist: NaN arguments shall be treated as missing data. so if one argument is a NaN and the other one is numeric? these functions shall choose the numeric value. the NaN just gets politely ignored. it's giving "we don't see her, she's not here". πŸ’€


πŸ‘‘ RETURN VALUE πŸ‘‘

Upon successful completion, these functions shall return the minimum 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 like: one NaN β†’ the real one wins πŸ†. both NaN β†’ NaN, because there's literally nothing else to give you, bestie.


πŸŽ€ ERRORS πŸŽ€

No errors are defined.

The following sections are informative. (translation: the rest is bonus lore, not the rulebook πŸ“–)


🌈 EXAMPLES 🌈

None.


πŸ“ APPLICATION USAGE πŸ“

None.


πŸ’œ RATIONALE πŸ’œ

None.


⭐ FUTURE DIRECTIONS ⭐

None.


πŸ”₯ SEE ALSO πŸ”₯

  • fdim()
  • fmax()

The Base Definitions volume of POSIX.1‐2017, <math.h>


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. (yes, the original is the one holding the whistle 🏳️)

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 u spot a typo it's probably a conversion glitch, not a plot hole. report it at the link above, mwah πŸ’‹

okay that's the whole page bestie, tysm for reading 🫢 this iconic little number came to you from IEEE/The Open Group, 2017, filed under FMIN(3POSIX). stan a float minimum. periodt. πŸ’…βœ¨