ISNAN(3P)

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

okay so this one lives in the POSIX Programmer's Manual and it's giving ✨ very short and very iconic ✨. Also hi, welcome, this is the 3P page, which is the POSIX-flavoured one, iykyk.


🌸 PROLOG 🌸

Real talk before we even start, bestie:

This manual page is part of the POSIX Programmer's Manual. 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.

🫢 translation: don't come for me if your Linux box does something slightly different. Check the Linux page too. It might literally not exist on Linux. Vibe check accordingly.

πŸ‘‘ NAME πŸ‘‘

isnan β€” test for a NaN


✨ SYNOPSIS ✨

#include <math.h>

int isnan(real-floating x);

πŸ’… DESCRIPTION πŸ’…

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. This volume of POSIX.1‐2017 defers to the ISO C standard.

🌈 no cap: if this page and the ISO C standard ever beef, the ISO C standard wins. Not me making the rules, that's just the rules.

The isnan() macro shall determine whether its argument value is a NaN.

First, an argument represented in a format wider than its semantic type is converted to its semantic type. Then determination is based on the type of the argument.

πŸ’€ yes it's a macro, not a function, and yes that matters. The conversion-then-check thing is literally in there. Read it twice, bestie, it's like two sentences and both of them are load-bearing.

πŸŽ€ RETURN VALUE πŸŽ€

The isnan() macro shall return a non-zero value if and only if its argument has a NaN value.

πŸ”₯ "if and only if" is doing SO much heavy lifting there. Non-zero = it's a NaN. Zero = it's not. No in-between, no maybe, no situationship. Periodt.

πŸ¦‹ ERRORS πŸ¦‹

No errors are defined.

The following sections are informative.

πŸ™ˆ literally nothing can go wrong here. No errno, no drama. It's a chill macro.

πŸ“ EXAMPLES πŸ“

None.


🧚 APPLICATION USAGE 🧚

None.


πŸ’œ RATIONALE πŸ’œ

None.


🌈 FUTURE DIRECTIONS 🌈

None.

⭐ the "None"s are really going through it in this page and honestly? Relatable. They understood the assignment: say nothing, say it cutely.

πŸ”₯ SEE ALSO πŸ”₯

  • fpclassify()
  • isfinite()
  • isinf()
  • isnormal()
  • signbit()

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

πŸ‘‘ the whole float-classification friend group. Go read all of them, they're a set, they slay together.

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 .

πŸ’– okay legal bestie moment: if this page and the official standard ever disagree, the official standard is the referee, fr fr. Also if you spot a typo, it's probably from the man-page conversion, and there's a link to report it. Not my fault, but I will absolutely pass it along. 🫢

and that's the whole page!! 🌸 mwah πŸ’‹

sign-off time, bestie: this was brought to you by IEEE/The Open Group, dated 2017, page name ISNAN(3P) β€” go test some NaNs, you absolute icon πŸ‘‘βœ¨πŸ’…

πŸ“¦ where this page comes from