ISLESSEQUAL(3POSIX)

πŸ’– ISLESSEQUAL(3POSIX) πŸ’–

okay so bestie, welcome to the POSIX Programmer's Manual 🌸 this little page right here is islessequal from the POSIX Programmer's Manual, and like, yes it's a manpage, but it's also kind of a whole mood. let's get into it 🫢


✨ PROLOG ✨

so like, real talk first: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β€” so if you're on Linux, go check the corresponding Linux manual page for the actual deets on Linux behavior, okay? or, plot twist, the interface might just not be implemented on Linux at all. πŸ’€ no cap, always double check.


πŸŽ€ NAME πŸŽ€

islessequal β€” the girl whose whole job is testing if x is less than or equal to y. that's it. that's the gig. πŸ‘‘


🌈 SYNOPSIS 🌈

#include <math.h>

int islessequal(real-floating x, real-floating y);

πŸ’… DESCRIPTION πŸ’…

so the functionality on this reference page is aligned with the ISO C standard, periodt. any conflict between what's described here and the ISO C standard is unintentional β€” nobody's trying to start drama. this volume of POSIX.1‐2017 defers to the ISO C standard, so like, that's the authority. πŸ’–

the islessequal() macro shall determine whether its first argument is less than or equal to its second argument. and the value of islessequal(x, y) shall be equal to (x) <= (y) β€” BUT (and this is the iconic part) unlike (x) <= (y), islessequal(x, y) shall not raise the invalid floating-point exception when x and y are unordered. it's giving polite. it's giving no-drama. 😌✨


πŸ”₯ RETURN VALUE πŸ”₯

upon successful completion, the islessequal() macro shall return the value of (x) <= (y). slay.

if x or y is NaN, 0 shall be returned. that's the rule bestie, no exceptions.


😭 ERRORS 😭

No errors are defined. literally none. she's unproblematic. πŸ™ˆ

the following sections are informative β€” iykyk, they're the bonus content, not the binding lore. πŸ’œ


🌸 EXAMPLES 🌸

None. okay so there's no example, bestie. we're working with vibes and the SYNOPSIS only. 🧚


πŸ¦‹ APPLICATION USAGE πŸ¦‹

okay so here's the tea. the relational and equality operators support the usual mathematical relationships between numeric values. for any ordered pair of numeric values, exactly one of the relationships β€” less, greater, and equal β€” is true. one. not two. not zero. exactly one. ⭐

but ⚠️ relational operators may raise the invalid floating-point exception when argument values are NaNs. for a NaN and a numeric value, or for two NaNs, just the unordered relationship is true.

so this macro is literally a quiet (non-floating-point-exception-raising) version of a relational operator. it facilitates writing efficient code that accounts for NaNs without suffering the invalid floating-point exception. no screaming, no crashing out, just quiet handling. πŸ’…

and quick note: in the SYNOPSIS section, real-floating indicates that the argument shall be an expression of real-floating type. that's what that means, bestie, don't skip it. 🌈


πŸ‘‘ RATIONALE πŸ‘‘

None. iconic of her honestly. nothing to justify. πŸŽ€


⭐ FUTURE DIRECTIONS ⭐

None. the future is undefined but like, in a chill way. πŸ’–


πŸ’œ SEE ALSO πŸ’œ

  • isgreater()
  • isgreaterequal()
  • isless()
  • islessgreater()
  • isunordered()

also, the Base Definitions volume of POSIX.1‐2017, <math.h> β€” go read it, bestie, it's the source material. πŸ“š


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 . πŸ›


ngl if you read this whole thing you're a real one. go forth and compare your floats quietly. no invalid exceptions, only vibes. 🫢

kisses, bestie πŸ’‹ this has been IEEE/The Open Group, 2017 β€” ISLESSEQUAL(3POSIX), out. πŸŽ€βœ¨