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:
- First, an argument represented in a format wider than its semantic type gets converted to its semantic type. (she's downsizing. slay.)
- 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. π
π 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 .
π 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 π«ΆπΈπ
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms