<!DOCTYPE html PUBLIC "‐//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">     <html
xmlns="http://www.w3.org/1999/xhtml"> <head>
    <link            rel="stylesheet"             type="text/css"
href="../../../style.css" title="style" />
    <link  rel="stylesheet"  type="text/css"  href="../style.css"
title="style" />
    <meta             http‐equiv="content‐type"              con‐
tent="text/html;charset=utf‐8" />

    <title>float.h.0p ‐ Linux manual page</title> </head>

<body>

<div        class="page‐top"><a       id="top_of_page"></a></div>
<!‐‐%%%TOP_BAR%%%‐‐> <!‐‐%%%PAGE_START%%%‐‐>

<table class="sec‐table"> <tr>
    <td>
        <p class="section‐dir"> <a href="#PROLOG">PROLOG</a> | <a
href="#NAME">NAME</a>  |  <a  href="#SYNOPSIS">SYNOPSIS</a>  | <a
href="#DESCRIPTION">DESCRIPTION</a> |  <a  href="#APPLICATION_US‐
AGE">APPLICATION&nbsp;USAGE</a>   |  <a  href="#RATIONALE">RATIO‐
NALE</a>   |   <a    href="#FUTURE_DIRECTIONS">FUTURE&nbsp;DIREC‐
TIONS</a>    |   <a   href="#SEE_ALSO">SEE&nbsp;ALSO</a>   |   <a
href="#COPYRIGHT">COPYRIGHT</a>
        </p>
    </td>
    <td class="search‐box">
        <div class="man‐search‐box">

            <form                method="get"                 ac‐
tion="http://www.google.com/search">
                <fieldset class="man‐search">
                    <input    type="text"    name="q"   size="10"
maxlength="255" value="" />
                    <input type="hidden"  name="sitesearch"  val‐
ue="man7.org/linux/man‐pages" />
                    <input  type="submit" name="sa" value="Search
online pages" />
                </fieldset>
            </form>

        </div>
    </td>
    <td> </td> </tr> </table>

<pre> <span class="headline">float.h(0P)               POSIX Pro‐
grammer’s  Manual               float.h(0P)</span>  </pre> <h2><a
id="PROLOG" href="#PROLOG"></a>PROLOG  &nbsp; &nbsp; &nbsp;  &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       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 be‐
havior), or
       the interface may not be implemented on Linux.

       delim $$  </pre>  <h2><a  id="NAME"  href="#NAME"></a>NAME
&nbsp;   &nbsp;   &nbsp;   &nbsp;   <a  href="#top_of_page"><span
class="top‐link">top</span></a></h2><pre>
       float.h  —  floating  types  </pre>  <h2><a  id="SYNOPSIS"
href="#SYNOPSIS"></a>SYNOPSIS   &nbsp;  &nbsp;  &nbsp;  &nbsp; <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       #include  &lt;float.h&gt;  </pre>  <h2><a id="DESCRIPTION"
href="#DESCRIPTION"></a>DESCRIPTION  &nbsp; &nbsp; &nbsp;  &nbsp;
<a              href="#top_of_page"><span             class="top‐
link">top</span></a></h2><pre>
       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‐2008 defers to the ISO C standard.

       The characteristics of floating types are defined in terms
of a model
       that describes a representation of floating‐point  numbers
and values
       that  provide information about an implementation’s float‐
ing‐point
       arithmetic.

       The following parameters are used to define the model  for
each
       floating‐point type:

       <i>s</i>     Sign (±1).

       <i>b</i>      Base or radix of exponent representation (an
integer &gt;1).

       <i>e</i>     Exponent (an integer between  a  minimum  $e_
min$ and a maximum
             $e_ max$).

       <i>p</i>     Precision (the number of base−<i>b</i> digits
in the significand).

       $f_ k$
             Non‐negative integers less than <i>b</i>  (the  sig‐
nificand digits).

       A floating‐point number <i>x</i> is defined by the follow‐
ing model:

       x  " "  =  " "  sb"^" e" "  " "  sum from k=1 to p^   "  "
f_ k" "  "
       "  b"^" " "‐k ,
            "  "   e_ min" "  " "  &lt;=  " "  e  " "  &lt;=  " "
e_ max" "

       In addition  to  normalized  floating‐point  numbers  ($f_
1$&gt;0 if <i>x</i>≠0),
       floating  types  may  be  able  to  contain other kinds of
floating‐point
       numbers,  such   as   subnormal   floating‐point   numbers
(<i>x</i>≠0, <i>e</i>=$e_ min$,
       $f_   1$=0)   and   unnormalized   floating‐point  numbers
(<i>x</i>≠0, <i>e</i>&gt;$e_ min$,
       $f_ 1$=0), and values that are not floating‐point numbers,
such as
       infinities  and NaNs. A <i>NaN</i> is an encoding signify‐
ing Not‐a‐Number. A
       <i>quiet NaN</i> propagates through  almost  every  arith‐
metic operation
       without raising a floating‐point exception; a <i>signaling
NaN</i> generally
       raises a floating‐point exception  when  occurring  as  an
arithmetic
       operand.

       An  implementation  may  give zero and non‐numeric values,
such as
       infinities and NaNs, a sign, or may leave  them  unsigned.
Wherever
       such  values are unsigned, any requirement in POSIX.1‐2008
to retrieve
       the sign shall produce an unspecified  sign  and  any  re‐
quirement to set
       the sign shall be ignored.

       The accuracy of the floating‐point operations (<b>’+’</b>,
<b>’−’</b>, <b>’*’</b>, <b>’/’</b>)
       and  of  the  functions   in   <i>&lt;math.h&gt;</i>   and
<i>&lt;complex.h&gt;</i> that return
       floating‐point  results  is  implementation‐defined, as is
the accuracy
       of the conversion between floating‐point  internal  repre‐
sentations and
       string  representations  performed  by  the  functions  in
<i>&lt;stdio.h&gt;</i>,
       <i>&lt;stdlib.h&gt;</i>, and <i>&lt;wchar.h&gt;</i>.   The
implementation may state that the
       accuracy is unknown.

       All  integer  values in the <i>&lt;float.h&gt;</i> header,
except FLT_ROUNDS, shall
       be  constant  expressions  suitable  for  use  in   <b>#if
</b>preprocessing
       directives;  all floating values shall be constant expres‐
sions. All
       except  DECIMAL_DIG,   FLT_EVAL_METHOD,   FLT_RADIX,   and
FLT_ROUNDS have
       separate  names  for  all  three floating‐point types. The
floating‐point
       model representation is provided for all values except
       FLT_EVAL_METHOD and FLT_ROUNDS.

       The rounding mode for floating‐point addition  is  charac‐
terized by the
       implementation‐defined value of FLT_ROUNDS:

       −1    Indeterminable.

        0    Toward zero.

        1    To nearest.

        2    Toward positive infinity.

        3    Toward negative infinity.

       All  other  values for FLT_ROUNDS characterize implementa‐
tion‐defined
       rounding behavior.

       The values of operations with floating operands and values
subject to
       the usual arithmetic conversions and of floating constants
are
       evaluated to a format whose range  and  precision  may  be
greater than
       required  by  the  type.  The use of evaluation formats is
characterized
       by the implementation‐defined value of FLT_EVAL_METHOD:

       −1    Indeterminable.

        0    Evaluate all operations and constants  just  to  the
range and
             precision of the type.

        1     Evaluate  operations and constants of type <b>float
</b>and <b>double </b>to
             the range and precision of the  <b>double  </b>type;
evaluate <b>long</b>
             <b>double  </b>operations and constants to the range
and precision of
             the <b>long double </b>type.

        2    Evaluate all operations and constants to  the  range
and
             precision of the <b>long double </b>type.

       All other negative values for FLT_EVAL_METHOD characterize
       implementation‐defined behavior.

       The <i>&lt;float.h&gt;</i> header shall define the follow‐
ing values as constant
       expressions with implementation‐defined  values  that  are
greater or
       equal  in  magnitude (absolute value) to those shown, with
the same
       sign.

        *  Radix of exponent representation, <i>b</i>.

           FLT_RADIX     2

        *  Number of base‐FLT_RADIX digits in the floating‐point
           significand, <i>p</i>.

           FLT_MANT_DIG

           DBL_MANT_DIG

           LDBL_MANT_DIG

        *  Number of decimal  digits,  <i>n</i>,  such  that  any
floating‐point number
           in  the  widest  supported floating type with $p_ max$
radix <i>b</i>
           digits can be rounded to a floating‐point number  with
<i>n</i> decimal
           digits and back again without change to the value.

           lpile  { p_ max" "  " "  log_ 10" "  " "  b above left
ceiling  "
           "  1  " "  +  " "  p_ max" "  " "  log_ 10" "  " "   b
right
           ceiling }
            " "   " "  lpile {if " " b " " is " " a " " power " "
of " " 10
           above otherwise}

           DECIMAL_DIG   10

        *  Number of decimal  digits,  <i>q</i>,  such  that  any
floating‐point number
           with  <i>q</i>  decimal  digits  can be rounded into a
floating‐point number
           with <i>p</i> radix <i>b</i>  digits  and  back  again
without change to the <i>q</i>
           decimal digits.

           lpile { p  " "  log_ 10" "  " "  b above left floor  "
"  (p  " "
           ‐  " "  1)  " "  log_ 10" "  " "  b  " "  right  floor
}
            " "   " "  lpile {if " " b " " is " " a " " power " "
of " " 10
           above otherwise}

           FLT_DIG       6

           DBL_DIG       10

           LDBL_DIG      10

        *  Minimum negative integer such that FLT_RADIX raised to
that power
           minus  1  is  a  normalized floating‐point number, $e_
min$.

           FLT_MIN_EXP

           DBL_MIN_EXP

           LDBL_MIN_EXP

        *  Minimum negative integer such that 10 raised  to  that
power is in
           the range of normalized floating‐point numbers.

           left  ceiling  " "  log_ 10" "  " "  b"^" " "{ e_ min"
"  " " "^"
           " "‐1 } ^  " "  right ceiling

           FLT_MIN_10_EXP
                         −37

           DBL_MIN_10_EXP
                         −37

           LDBL_MIN_10_EXP
                         −37

        *  Maximum integer such that  FLT_RADIX  raised  to  that
power minus 1
           is  a  representable finite floating‐point number, $e_
max$.

           FLT_MAX_EXP

           DBL_MAX_EXP

           LDBL_MAX_EXP

           Additionally, FLT_MAX_EXP shall be at least  as  large
as
           FLT_MANT_DIG,  DBL_MAX_EXP  shall be at least as large
as
           DBL_MANT_DIG, and LDBL_MAX_EXP shall be  at  least  as
large as
           LDBL_MANT_DIG;  which  has  the  effect  that FLT_MAX,
DBL_MAX, and
           LDBL_MAX are integral.

        *  Maximum integer such that 10 raised to that  power  is
in the range
           of representable finite floating‐point numbers.

           left floor  " "  log_ 10" " ( ( 1  " "  ‐  " "  b"^" "
"‐p )  " "
               b"^" e" "_ max" "^ )  " "  right floor

           FLT_MAX_10_EXP
                         +37

           DBL_MAX_10_EXP
                         +37

           LDBL_MAX_10_EXP
                         +37

       The <i>&lt;float.h&gt;</i> header shall define the follow‐
ing values as constant
       expressions  with  implementation‐defined  values that are
greater than
       or equal to those shown:

        *  Maximum representable finite floating‐point number.

           (1  " "  ‐  " "  b"^" " "‐p^)  " "  b"^" e" "_ max" "

           FLT_MAX       1E+37

           DBL_MAX       1E+37

           LDBL_MAX      1E+37

       The <i>&lt;float.h&gt;</i> header shall define the follow‐
ing values as constant
       expressions  with implementation‐defined (positive) values
that are
       less than or equal to those shown:

        *  The difference between 1 and the least  value  greater
than 1 that
           is  representable  in  the  given floating‐point type,
$b"^" " "{1 "
           " ‐ " " p}$.

           FLT_EPSILON   1E−5

           DBL_EPSILON   1E−9

           LDBL_EPSILON  1E−9

        *  Minimum  normalized  positive  floating‐point  number,
$b"^" " "{ e_
           min" "  " " "^" " "‐1 }$.

           FLT_MIN       1E−37

           DBL_MIN       1E−37

           LDBL_MIN      1E−37

       <i>The  following  sections  are  informative.</i>  </pre>
<h2><a  id="APPLICATION_USAGE"  href="#APPLICATION_USAGE"></a>AP‐
PLICATION    USAGE     &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       None.     </pre>   <h2><a   id="RATIONALE"   href="#RATIO‐
NALE"></a>RATIONALE    &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       All known  hardware  floating‐point  formats  satisfy  the
property that
       the  exponent  range is larger than the number of mantissa
digits. The
       ISO C standard permits a floating‐point format where  this
property is
       not  true, such that the largest finite value would not be
integral;
       however, it is unlikely that there will ever  be  hardware
support for
       such  a  floating‐point format, and it introduces boundary
cases that
       portable programs should not have  to  be  concerned  with
(for example,
       a non‐integral DBL_MAX means that <i>ceil</i>() would have
to worry about
       overflow). Therefore, this standard imposes an  additional
requirement
       that  the  largest representable finite value is integral.
</pre>   <h2><a    id="FUTURE_DIRECTIONS"    href="#FUTURE_DIREC‐
TIONS"></a>FUTURE  DIRECTIONS   &nbsp;  &nbsp;  &nbsp;  &nbsp; <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       None.     </pre>   <h2><a   id="SEE_ALSO"   href="#SEE_AL‐
SO"></a>SEE   ALSO     &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       <a href="../man0/complex.h.0p.html">complex.h(0p)</a>,  <a
href="../man0/math.h.0p.html">math.h(0p)</a>,                  <a
href="../man0/stdio.h.0p.html">stdio.h(0p)</a>,                <a
href="../man0/stdlib.h.0p.html">stdlib.h(0p)</a>,              <a
href="../man0/wchar.h.0p.html">wchar.h(0p)</a>   </pre>    <h2><a
id="COPYRIGHT"   href="#COPYRIGHT"></a>COPYRIGHT   &nbsp;  &nbsp;
&nbsp;   &nbsp;    <a    href="#top_of_page"><span    class="top‐
link">top</span></a></h2><pre>
       Portions  of  this  text  are  reprinted and reproduced in
electronic form
       from IEEE Std 1003.1, 2013 Edition, Standard for  Informa‐
tion
       Technology ‐‐ Portable Operating System Interface (POSIX),
The Open
       Group Base Specifications Issue 7, Copyright (C)  2013  by
the
       Institute of Electrical and Electronics Engineers, Inc and
The Open
       Group.  (This is POSIX.1‐2008 with the 2013 Technical Cor‐
rigendum 1
       applied.)  In  the  event  of any discrepancy between this
version and
       the original IEEE and The Open Group Standard, the  origi‐
nal IEEE and
       The Open Group Standard is the referee document. The orig‐
inal
       Standard    can    be    obtained     online     at     <a
href="http://www.unix.org/online.html">http://www.unix.org/on‐
line.html</a> .

       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
       <a      href="https://www.kernel.org/doc/man‐pages/report‐
ing_bugs.html">https://www.kernel.org/doc/man‐pages/report‐
ing_bugs.html</a> .

<span  class="footline">IEEE/The  Open Group                 2013
float.h(0P)</span> </pre>

<hr class="end‐man‐text" />

<hr class="start‐footer" />

<div class="footer">

<table class="colophon‐table">
    <tr>
    <td class="pub‐info">
        <p>
            HTML rendering created 2019‐08‐02
            by  <a  href="http://man7.org/mtk/index.html">Michael
Kerrisk</a>,
            author of
            <a  href="http://man7.org/tlpi/"><em>The  Linux  Pro‐
gramming Interface</em></a>,
            maintainer of the
            <a href="https://www.kernel.org/doc/man‐pages/">Linux
<em>man‐pages</em> project</a>.
        </p>
        <p>
            For details of in‐depth
            <strong>Linux/UNIX  system programming training cour‐
ses</strong>
            that I teach,  look  <a  href="http://man7.org/train‐
ing/">here</a>.
        </p>
        <p>
            Hosting    by    <a   href="http://www.jambit.com/in‐
dex_en.html">jambit GmbH</a>.
        </p>
        <p>
            <a href="http://validator.w3.org/check?uri=referer">
            <img src="http://www.w3.org/Icons/valid‐xhtml11"
                alt="Valid XHTML 1.1" height="31" width="88" />
            </a>
        </p>
    </td>
    <td class="colophon‐divider">
    </td>
    <td class="tlpi‐cover">
        <a                      href="http://man7.org/tlpi/"><img
src="http://man7.org/tlpi/cover/TLPI‐front‐cover‐vsmall.png"
alt="Cover of TLPI" /></a>
    </td>
    </tr> </table>

</div>

<hr class="end‐footer" />

</body> </html>