Files
oldlinux-files/Ref-docs/c_lib_guide/2.4.html
2024-02-19 00:21:47 -05:00

220 lines
4.2 KiB
HTML

<html>
<head>
<title>
C Guide--2.4 float.h
</title>
<!-- Changed by: eric huss, 12-Mar-1997 -->
</head>
<body text="#000000" bgcolor="#FFFFFF">
<center>
<table border=0 width=100%>
<tr>
<td align=left width=20% valign=top>
<a href="2.3.html">
<img src="left.gif" border=0>
Previous Section<br>
2.3 errno.h</a></td>
<td align=center width=60% valign=top>
| <a href="index.html">Table of Contents</a> |
<a href="index2.html">Index</a> |</td>
<td align=right width=20% valign=top>
<a href="2.5.html">
Next Section
<img src="right.gif" border=0><br>
2.5 limits.h</a></td>
</tr>
</table>
</center>
<hr>
<h1>2.4 float.h</h1>
<p>
The float header defines the minimum and maximum limits of floating-point number
values.
<p>
<h2>2.4.1 Defined Values</h2>
<p>
A floating-point number is defined in the following manner:
<blockquote>
<i>sign value </i>E<i> exponent</i>
</blockquote>
Where <i>sign</i> is plus or minus, <i>value</i> is the value of the number, and <i>exponent</i> is the value
of the exponent.
<p>
The following values are defined with the <code><b>#define</b></code> directive. These values are
implementation-specific, but may not be any lower than what is given here. Note that in all
instances <code><b>FLT</b></code> refers to type float, <code><b>DBL</b></code> refers to double, and <code><b>LDBL</b></code> refers to long double.
<p>
<table border=1>
<tr>
<td>
<code><b>FLT_ROUNDS</b></code><br>
</td>
<td>
Defines the way floating-point numbers are rounded.<br>
<br>
<table border=0>
<tr>
<td><code><b>-1</b></code></td><td> indeterminable</td></tr>
<tr>
<td><code><b>0</b></code></td><td> toward zero</td></tr>
<tr>
<td><code><b>1</b></code></td><td> to nearest</td></tr>
<tr>
<td><code><b>2</b></code></td><td> toward positive infinity</td></tr>
<tr>
<td><code><b>3</b></code></td><td> toward negative infinity</td></tr>
</table>
</td>
</tr>
<tr>
<td>
<code><b>FLT_RADIX 2</b></code><br>
</td>
<td>
Defines the base (radix) representation of the exponent (i.e. base-2 is binary, base-10 is
the normal decimal representation, base-16 is Hex).
</td>
</tr>
<tr>
<td>
<code><b>
FLT_MANT_DIG<br>
DBL_MANT_DIG<br>
LDBL_MANT_DIG<br>
</b></code>
</td>
<td>
Defines the number of digits in the number (in the <code><b>FLT_RADIX</b></code> base).
</td>
</tr>
<tr>
<td>
<code><b>
FLT_DIG 6<br>
DBL_DIG 10<br>
LDBL_DIG 10<br>
</b></code>
</td>
<td>
The maximum number decimal digits (base-10) that can be represented without change
after rounding.
</td>
</tr>
<tr>
<td>
<code><b>
FLT_MIN_EXP<br>
DBL_MIN_EXP<br>
LDBL_MIN_EXP<br>
</b></code>
</td>
<td>
The minimum negative integer value for an exponent in base FLT_RADIX.
</td>
</tr>
<tr>
<td>
<code><b>
FLT_MIN_10_EXP -37<br>
DBL_MIN_10_EXP -37<br>
LDBL_MIN_10_EXP -37<br>
</b></code>
</td>
<td>
The minimum negative integer value for an exponent in base 10.
</td>
</tr>
<tr>
<td>
<code><b>
FLT_MAX_EXP<br>
DBL_MAX_EXP<br>
LDBL_MAX_EXP<br>
</b></code>
</td>
<td>
The maximum integer value for an exponent in base FLT_RADIX.
</td>
</tr>
<tr>
<td>
<code><b>
FLT_MAX_10_EXP +37<br>
DBL_MAX_10_EXP +37<br>
LDBL_MAX_10_EXP +37<br>
</b></code>
</td>
<td>
The maximum integer value for an exponent in base 10.
</td>
</tr>
<tr>
<td>
<code><b>
FLT_MAX 1E+37<br>
DBL_MAX 1E+37<br>
LDBL_MAX 1E+37<br>
</b></code>
</td><td>
Maximum finite floating-point value.
</td>
</tr>
<tr>
<td>
<code><b>
FLT_EPSILON 1E-5<br>
DBL_EPSILON 1E-9<br>
LDBL_EPSILON 1E-9<br>
</b></code>
</td>
<td>
Least significant digit representable.
</td>
</tr>
<tr>
<td>
<code><b>
FLT_MIN 1E-37<br>
DBL_MIN 1E-37<br>
LDBL_MIN 1E-37<br>
</b></code>
</td>
<td>
Minimum floating-point value.
</td>
</tr>
</table>
<hr>
<center>
<table border=0 width=100%>
<tr>
<td align=left width=20% valign=top>
<a href="2.3.html">
<img src="left.gif" border=0>
Previous Section<br>
2.3 errno.h</a></td>
<td align=center width=60% valign=top>
| <a href="index.html">Table of Contents</a> |
<a href="index2.html">Index</a> |</td>
<td align=right width=20% valign=top>
<a href="2.5.html">
Next Section
<img src="right.gif" border=0><br>
2.5 limits.h</a></td>
</tr>
</table>
</center>
</body>
</html>