2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved.
44 .\" Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
46 .TH FLOAT.H 3HEAD "Dec 17, 2003"
48 float.h, float \- floating types
52 #include <\fBfloat.h\fR>
58 The characteristics of floating types are defined in terms of a model that
59 describes a representation of floating-point numbers and values that provide
60 information about an implementation's floating-point arithmetic.
63 The following parameters are used to define the model for each floating-point
80 base or radix of exponent representation (an integer >1)
89 exponent (an integer between a minimum e(min) and a maximum e(max))
98 precision (the number of base-\fIb\fR digits in the significand)
104 \fB\fIf\fR(\fIk\fR)\fR
107 non-negative integers less than \fIb\fR (the significand digits)
112 In addition to normalized floating-point numbers (\fIf\fR(1)>0 if
113 \fIx\fR\(!=0), floating types might be able to contain other kinds of
114 floating-point numbers, such as subnormal floating-point numbers (x\(!=0,
115 e=e(min), f(1)=0) and unnormalized floating-point numbers (x\(!=0, e=e(min),
116 f(1)=0), and values that are not floating-point numbers, such as infinities and
117 NaNs. A \fBNaN\fR is an encoding signifying Not-a-Number. A \fBquiet NaN\fR
118 propagates through almost every arithmetic operation without raising a
119 floating-point exception; a \fBsignaling NaN\fR generally raises a
120 floating-point exception when occurring as an arithmetic operand.
123 The accuracy of the library functions in \fBmath.h\fR(3HEAD) and
124 \fBcomplex.h\fR(3HEAD) that return floating-point results is defined on the
125 \fBlibm\fR(3LIB) manual page.
128 All integer values in the <\fBfloat.h\fR> header, except \fBFLT_ROUNDS\fR, are
129 constant expressions suitable for use in \fB#if\fR preprocessing directives;
130 all floating values are constant expressions. All except \fBDECIMAL_DIG\fR,
131 \fBFLT_EVAL_METHOD\fR, \fBFLT_RADIX\fR, and \fBFLT_ROUNDS\fR have separate
132 names for all three floating-point types. The floating-point model
133 representation is provided for all values except \fBFLT_EVAL_METHOD\fR and
137 The rounding mode for floating-point addition is characterized by the value of
172 Toward positive infinity.
181 Toward negative infinity.
186 The values of operations with floating operands and values subject to the usual
187 arithmetic conversions and of floating constants are evaluated to a format
188 whose range and precision might be greater than required by the type. The use
189 of evaluation formats is characterized by the architecture-dependent value of
190 \fBFLT_EVAL_METHOD\fR:
206 Evaluate all operations and constants just to the range and precision of the
216 Evaluate operations and constants of type float and double to the range and
217 precision of the double type; evaluate long double operations and constants to
218 the range and precision of the long double type.
227 Evaluate all operations and constants to the range and precision of the long
233 The values given in the following list are defined as constants.
238 Radix of exponent representation, \fIb\fR.
251 Number of base-\fBFLT_RADIX\fR digits in the floating-point significand,
267 Number of decimal digits, \fIn\fR, such that any floating-point number in the
268 widest supported floating type with \fIp\fR(max) radix \fIb\fR digits can be
269 rounded to a floating-point number with \fIn\fR decimal digits and back again
270 without change to the value.
283 Number of decimal digits, \fIq\fR, such that any floating-point number with
284 \fIq\fR decimal digits can be rounded into a floating-point number with \fIp\fR
285 radix \fIb\fR digits and back again without change to the \fIq\fR decimal
301 Minimum negative integer such that \fBFLT_RADIX\fR raised to that power minus 1
302 is a normalized floating-point number, e(min).
317 Minimum negative integer such that 10 raised to that power is in the range of
318 normalized floating-point numbers.
333 Maximum integer such that \fBFLT_RADIX\fR raised to that power minus 1 is a
334 representable finite floating-point number, e(max).
349 Maximum integer such that 10 raised to that power is in the range of
350 representable finite floating-point numbers.
363 The values given in the following list are defined as constant expressions with
364 values that are greater than or equal to those shown:
369 Maximum representable finite floating-point number.
382 The values given in the following list are defined as constant expressions with
383 implementation-defined (positive) values that are less than or equal to those
389 The difference between 1 and the least value greater than 1 that is
390 representable in the given floating-point type, \fIb\fR^1 -\fI p\fR.
405 Minimum normalized positive floating-point number, \fIb\fR^e(min)^-1.
419 See \fBattributes\fR(5) for descriptions of the following attributes:
427 ATTRIBUTE TYPE ATTRIBUTE VALUE
429 Interface Stability Standard
435 \fBcomplex.h\fR(3HEAD), \fBmath.h\fR(3HEAD), \fBattributes\fR(5),