ISNAN(3POSIX)

πŸ’– ISNAN(3POSIX) β€” the POSIX Programmer's Manual, but make it cute πŸ’–

okay bestie, welcome to isnan from the POSIX Programmer's Manual. this one's short, it's sweet, and it's literally just "is this number a NaN or not." iconic behavior honestly. πŸ¦‹


🚨 PROLOG (read this first, fr fr) 🚨

so like, this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so pls go consult the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface may not be implemented on Linux at all. not every baddie makes it to every platform, yk? πŸ’…


✨ NAME ✨

isnan β€” test for a NaN

like. that's it. that's the whole job. she checks if ur float is Not A Number. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <math.h>

int isnan(real-floating x);

πŸ’œ DESCRIPTION πŸ’œ

okay so first things first, 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 β€” no drama intended. this volume of POSIX.1‐2017 defers to the ISO C standard. periodt. πŸ’–

now the actual tea: the isnan() macro shall determine whether its argument value is a NaN.

how does she do it? two steps, bestie:

  1. First, an argument represented in a format wider than its semantic type gets converted to its semantic type. (she's downsizing. slay.)
  2. Then the determination is based on the type of the argument.

that's the whole vibe check. 🌈


🫢 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," bestie. she's not being vague about it. NaN in β†’ nonzero out, everything else β†’ not that. πŸ’€βœ¨


πŸ™ˆ ERRORS πŸ™ˆ

no errors are defined. she simply does not miss. 😌

also heads up: the following sections are informative. (yes, that includes the next few. they're vibes, not requirements.)

πŸŽ€ EXAMPLES πŸŽ€

None.

(i know. i know. but that's genuinely what it says. nothing to demo here. 😭)


πŸ“ APPLICATION USAGE πŸ“

None.


🧚 RATIONALE 🧚

None.


⭐ FUTURE DIRECTIONS ⭐

None.


πŸ”₯ SEE ALSO πŸ”₯

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

and also the Base Definitions volume of POSIX.1‐2017, specifically <math.h>. go read the header, she's the source of truth. πŸ‘‘


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 u spot a typo it's probably the man page conversion's fault, not the standard's. don't @ the IEEE.

and that's the whole page bestie!! πŸ’…βœ¨

IEEE/The Open Group β€” 2017 β€” ISNAN(3POSIX)

mwah, ily, go check ur floats for NaN responsibly πŸ«ΆπŸŒΈπŸ’–