man-pages/man3/INFINITY.3.html
2021-03-31 01:06:50 +01:00

155 lines
2.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of INFINITY</TITLE>
</HEAD><BODY>
<H1>INFINITY</H1>
Section: Linux Programmer's Manual (3)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL - floating-point constants
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#define _ISOC99_SOURCE</B> /* See <A HREF="/cgi-bin/man/man2html?7+feature_test_macros">feature_test_macros</A>(7) */
<B>#include &lt;<A HREF="file:///usr/include/math.h">math.h</A>&gt;</B>
<B>INFINITY</B>
<B>NAN</B>
<B>HUGE_VAL</B>
<B>HUGE_VALF</B>
<B>HUGE_VALL</B>
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The macro
<B>INFINITY</B>
expands to a
<I>float</I>
constant representing positive infinity.
<P>
The macro
<B>NAN</B>
expands to a
<I>float</I>
constant representing a quiet NaN
(when supported).
A
<I>quiet</I>
NaN is a NaN (&quot;not-a-number&quot;) that does not raise exceptions
when it is used in arithmetic.
The opposite is a
<I>signaling</I>
NaN.
See IEC 60559:1989.
<P>
The macros
<B>HUGE_VAL</B>,
<B>HUGE_VALF</B>,
<B>HUGE_VALL</B>
expand to constants of types
<I>double</I>,
<I>float</I>
and
<I>long double</I>,
respectively,
that represent a large positive value, possibly positive infinity.
<A NAME="lbAE">&nbsp;</A>
<H2>CONFORMING TO</H2>
C99.
<A NAME="lbAF">&nbsp;</A>
<H2>AVAILABILITY</H2>
On a glibc system, the macro
<B>HUGE_VAL</B>
is always available.
Availability of the
<B>NAN</B>
macro can be tested using
<B>#ifdef NAN</B>,
and similarly for
<B>INFINITY</B>,
<B>HUGE_VALF</B>,
<B>HUGE_VALL</B>.
They will be defined by
<I>&lt;<A HREF="file:///usr/include/math.h">math.h</A>&gt;</I>
if
<B>_ISOC99_SOURCE</B>
or
<B>_GNU_SOURCE</B>
is defined, or
<B>__STDC_VERSION__</B>
is defined
and has a value not less than 199901L.
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+fpclassify">fpclassify</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?7+math_error">math_error</A></B>(7)
<A NAME="lbAH">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">CONFORMING TO</A><DD>
<DT id="5"><A HREF="#lbAF">AVAILABILITY</A><DD>
<DT id="6"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="7"><A HREF="#lbAH">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:46 GMT, March 31, 2021
</BODY>
</HTML>