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.
π COPYRIGHT π
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
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms