9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3head / float.h.3head
blobc7bb37c03f27e6d4507b0cb2c5a1b510a8473c08
1 .\"
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/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
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.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
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.
30 .\"
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.
35 .\"
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]
41 .\"
42 .\"
43 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
44 .\" Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
45 .\"
46 .TH FLOAT.H 3HEAD "Dec 17, 2003"
47 .SH NAME
48 float.h, float \- floating types
49 .SH SYNOPSIS
50 .LP
51 .nf
52 #include <\fBfloat.h\fR>
53 .fi
55 .SH DESCRIPTION
56 .sp
57 .LP
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.
61 .sp
62 .LP
63 The following parameters are used to define the model for each floating-point
64 type:
65 .sp
66 .ne 2
67 .na
68 \fB\fIs\fR\fR
69 .ad
70 .RS 6n
71 sign (\(+-1)
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fIb\fR\fR
78 .ad
79 .RS 6n
80 base or radix of exponent representation (an integer >1)
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fIe\fR\fR
87 .ad
88 .RS 6n
89 exponent (an integer between a minimum e(min) and a maximum e(max))
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fIp\fR\fR
96 .ad
97 .RS 6n
98 precision (the number of base-\fIb\fR digits in the significand)
99 .RE
102 .ne 2
104 \fB\fIf\fR(\fIk\fR)\fR
106 .RS 6n
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
134 \fBFLT_ROUNDS\fR.
137 The rounding mode for floating-point addition is characterized by the value of
138 \fBFLT_ROUNDS\fR:
140 .ne 2
142 \fB\fB-1\fR\fR
144 .RS 6n
145 Indeterminable.
149 .ne 2
151 \fB\fB0\fR\fR
153 .RS 6n
154 Toward zero.
158 .ne 2
160 \fB\fB1\fR\fR
162 .RS 6n
163 To nearest.
167 .ne 2
169 \fB\fB2\fR\fR
171 .RS 6n
172 Toward positive infinity.
176 .ne 2
178 \fB\fB3\fR\fR
180 .RS 6n
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:
192 .ne 2
194 \fB\fB-1\fR\fR
196 .RS 6n
197 Indeterminable.
201 .ne 2
203 \fB\fB0\fR\fR
205 .RS 6n
206 Evaluate all operations and constants just to the range and precision of the
207 type.
211 .ne 2
213 \fB\fB1\fR\fR
215 .RS 6n
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.
222 .ne 2
224 \fB\fB2\fR\fR
226 .RS 6n
227 Evaluate all operations and constants to the range and precision of the long
228 double type.
233 The values given in the following list are defined as constants.
234 .RS +4
236 .ie t \(bu
237 .el o
238 Radix of exponent representation, \fIb\fR.
240 .in +2
242 FLT_RADIX
244 .in -2
247 .RS +4
249 .ie t \(bu
250 .el o
251 Number of base-\fBFLT_RADIX\fR digits in the floating-point significand,
252 \fIp\fR.
254 .in +2
256 FLT_MANT_DIG
257 DBL_MANT_DIG
258 LDBL_MANT_DIG
260 .in -2
263 .RS +4
265 .ie t \(bu
266 .el o
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.
272 .in +2
274 DECIMAL_DIG
276 .in -2
279 .RS +4
281 .ie t \(bu
282 .el o
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
286 digits.
288 .in +2
290 FLT_DIG
291 DBL_DIG
292 LDBL_DIG
294 .in -2
297 .RS +4
299 .ie t \(bu
300 .el o
301 Minimum negative integer such that \fBFLT_RADIX\fR raised to that power minus 1
302 is a normalized floating-point number, e(min).
304 .in +2
306 FLT_MIN_EXP
307 DBL_MIN_EXP
308 LDBL_MIN_EXP
310 .in -2
313 .RS +4
315 .ie t \(bu
316 .el o
317 Minimum negative integer such that 10 raised to that power is in the range of
318 normalized floating-point numbers.
320 .in +2
322 FLT_MIN_10_EXP
323 DBL_MIN_10_EXP
324 LDBL_MIN_10_EXP
326 .in -2
329 .RS +4
331 .ie t \(bu
332 .el o
333 Maximum integer such that \fBFLT_RADIX\fR raised to that power minus 1 is a
334 representable finite floating-point number, e(max).
336 .in +2
338 FLT_MAX_EXP
339 DBL_MAX_EXP
340 LDBL_MAX_EXP
342 .in -2
345 .RS +4
347 .ie t \(bu
348 .el o
349 Maximum integer such that 10 raised to that power is in the range of
350 representable finite floating-point numbers.
352 .in +2
354 FLT_MAX_10_EXP
355 DBL_MAX_10_EXP
356 LDBL_MAX_10_EXP
358 .in -2
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:
365 .RS +4
367 .ie t \(bu
368 .el o
369 Maximum representable finite floating-point number.
371 .in +2
373 FLT_MAX
374 DBL_MAX
375 LDBL_MAX
377 .in -2
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
384 shown:
385 .RS +4
387 .ie t \(bu
388 .el o
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.
392 .in +2
394 FLT_EPSILON
395 DBL_EPSILON
396 LDBL_EPSILON
398 .in -2
401 .RS +4
403 .ie t \(bu
404 .el o
405 Minimum normalized positive floating-point number, \fIb\fR^e(min)^-1.
407 .in +2
409 FLT_MIN
410 DBL_MIN
411 LDBL_MIN
413 .in -2
416 .SH ATTRIBUTES
419 See \fBattributes\fR(5) for descriptions of the following attributes:
424 box;
425 c | c
426 l | l .
427 ATTRIBUTE TYPE  ATTRIBUTE VALUE
429 Interface Stability     Standard
432 .SH SEE ALSO
435 \fBcomplex.h\fR(3HEAD), \fBmath.h\fR(3HEAD), \fBattributes\fR(5),
436 \fBstandards\fR(5)