ISUNORDERED(3POSIX)

✨ ISUNORDERED ✨

okay bestie, welcome to the POSIX Programmer's Manual πŸ’… this page is ISUNORDERED(3POSIX) and it's short, sweet, and honestly a little iconic.

πŸ’– PROLOG πŸ’–

okay so real talk before we get into it: this manual page is part of the POSIX Programmer's Manual, periodt. but listen β€” the Linux implementation of this interface may differ (so like, go consult the corresponding Linux manual page for the deets on Linux behavior), or the interface might not even be implemented on Linux at all. πŸ™ˆ so don't come for me if your Linux box is like "what is that."


🌸 NAME 🌸

isunordered β€” test if arguments are unordered

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <math.h>

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

✨ DESCRIPTION ✨

okay so the functionality described on this reference page is aligned with the ISO C standard. if there's any conflict between what's written here and the ISO C standard, that conflict is unintentional β€” not a vibe, just a formatting oopsie. this volume of POSIX.1‐2017 defers to the ISO C standard. iykyk.

the isunordered() macro shall determine whether its arguments are unordered. that's it. that's the whole job. 🫢

πŸ”₯ RETURN VALUE πŸ”₯

upon successful completion, the isunordered() macro shall return 1 if its arguments are unordered, and 0 otherwise.

and listen β€” if x or y is NaN, 1 shall be returned. so like, NaN in the mix means it's giving unordered, no cap. 😭

πŸ’€ ERRORS πŸ’€

no errors are defined. none. zero. she simply does not miss.

the following sections are informative.

πŸŽ€ EXAMPLES πŸŽ€

none. bestie i know, i wanted examples too. πŸ₯²

🌈 APPLICATION USAGE 🌈

okay so 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. slay, standard math behavior.

but here's the tea: 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. she's the chill one. it facilitates writing efficient code that accounts for NaNs without suffering the invalid floating-point exception. obsessed, honestly. πŸ‘‘

and just so we're clear: in the SYNOPSIS section, real-floating indicates that the argument shall be an expression of real-floating type. πŸ’…

πŸ’œ RATIONALE πŸ’œ

none. main character silence.

⭐ FUTURE DIRECTIONS ⭐

none. she's not going anywhere, she's not changing, she's perfect as is.

🧚 SEE ALSO 🧚

  • isgreater()
  • isgreaterequal()
  • isless()
  • islessequal()
  • islessgreater()

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. 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 .


k that's the whole page bestie, hope it ate 🫢

IEEE/The Open Group β€” 2017 β€” ISUNORDERED(3POSIX) ✨ bye luv u, go write some NaN-safe code πŸ’–