ISLESS(3POSIX)

πŸ’– ISLESS(3POSIX) β€” the POSIX Programmer's Manual, bestie edition πŸ’–

okay so before we even start: this page lives in the POSIX Programmer's Manual (yes, that's the 3POSIX up there in the header, hi hello). Buckle up buttercup, we're comparing floats. πŸ¦‹


🌸 PROLOG 🌸

Heads up, bestie, real talk first:

  • This manual page is part of the POSIX Programmer's Manual.
  • The Linux implementation of this interface may differ β€” so pls consult the corresponding Linux manual page for details on Linux behavior.
  • Or… the interface may not be implemented on Linux at all. πŸ’€

So like. vibe check your platform first. iykyk.


✨ NAME ✨

isless β€” test if x is less than y 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <math.h>

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

she's short, she's sweet, she's a macro. periodt. πŸ’…


🌈 DESCRIPTION 🌈

The functionality on this reference page is aligned with the ISO C standard. And listen β€” any conflict between the requirements described here and the ISO C standard is unintentional, no cap. This volume of POSIX.1‐2017 defers to the ISO C standard. the ISO C standard is the main character here, we're just living in her house. πŸ‘‘

So what does isless() actually do? The isless() macro shall determine whether its first argument is less than its second argument.

And here's the tea πŸ“: the value of isless(x, y) shall be equal to (x) < (y). BUT β€” and this is the iconic part β€” unlike (x) < (y), isless(x, y) shall not raise the invalid floating-point exception when x and y are unordered. she's the chill version. she doesn't start drama. 🧚


πŸ’œ RETURN VALUE πŸ’œ

Upon successful completion, the isless() macro shall return the value of (x) < (y).

And if x or y is NaN? 0 shall be returned. that's it, that's the answer, no exceptions raised, no screaming, just a calm little zero. 😌


πŸ”₯ ERRORS πŸ”₯

No errors are defined. (iconic behavior honestly β€” not a single problem to report πŸ’–)

The following sections are informative. (translation: the rest is bonus lore, not requirements ✨)


🌟 EXAMPLES 🌟

None. 😭 not a single example, we're thriving on vibes alone.


πŸ‘‘ APPLICATION USAGE πŸ‘‘

okay so here's the lore, bestie, sit down 🫢

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.

But β€” plot twist β€” 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.

This macro is 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. like, she does the same job but she doesn't yell at you. queen shit. πŸ‘‘

And in the SYNOPSIS section, real-floating indicates that the argument shall be an expression of real-floating type. noted. πŸ“


πŸ¦‹ RATIONALE πŸ¦‹

None. (she simply has nothing to justify. flawless. no notes. πŸ’…)


🌸 FUTURE DIRECTIONS 🌸

None. the future is bright and also empty. ✨


πŸŽ€ SEE ALSO πŸŽ€

  • isgreater()
  • isgreaterequal()
  • islessequal()
  • islessgreater()
  • isunordered()

and the Base Definitions volume of POSIX.1‐2017, <math.h> πŸ“š

(the whole friend group!! go say hi to all of them 🫢)


okay legal bestie moment, don't skip this, it's important:

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 .


and that's the whole page, bestie!! this lil masterpiece dropped in 2017, brought to you by IEEE / The Open Group πŸ’œ thanks for reading all the way to the bottom, you're literally the best, mwah πŸŽ€βœ¨πŸ’