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 1989 AT&T.
44 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
46 .TH MATH.H 3HEAD "Aug 11, 2004"
48 math.h, math \- mathematical declarations
52 \fB#include <math.h>\fR
58 The <\fBmath.h\fR> header includes definitions for the following types:
65 A real-floating type at least as wide as \fBfloat\fR.
74 A real-floating type at least as wide as \fBdouble\fR, and at least as wide as
80 If \fBFLT_EVAL_METHOD\fR equals 0, \fBfloat_t\fR and \fBdouble_t\fR are
81 \fBfloat\fR and \fBdouble\fR, respectively. If \fBFLT_EVAL_METHOD\fR equals 1,
82 they are both \fBdouble\fR. If \fBFLT_EVAL_METHOD\fR equals 2, they are both be
83 \fBlong double\fR. Other values of \fBFLT_EVAL_METHOD\fR are
84 implementation-defined.
87 The <\fBmath.h\fR> header provides the following constants. The values are of
88 type \fBdouble\fR and are accurate within the precision of the \fBdouble\fR
96 The base of natural logarithms (\fIe\fR).
105 The base-2 logarithm of \fIe\fR.
114 The base-10 logarithm of \fIe\fR.
123 The natural logarithm of 2.
132 The natural logarithm of 10.
145 , the ratio of the circumference of a circle to its diameter.
203 \fB\fBM_2_SQRTPI\fR\fR
206 2 over the square root of \c
219 The positive square root of 2.
225 \fB\fBM_SQRT1_2\fR\fR
228 The positive square root of 1/2.
233 The <\fBmath.h\fR> header defines the following symbolic constants:
240 The maximum value of a non-infinite single-precision floating point number.
249 A positive \fBdouble\fR expression, not necessarily representable as a float.
250 Used as an error value returned by the mathematics library. \fBHUGE_VAL\fR
251 evaluates to +infinity on systems supporting IEEE Std 754-1985.
257 \fB\fBHUGE_VALF\fR\fR
260 A positive \fBfloat\fR constant expression. Used as an error value returned by
261 the mathematics library. \fBHUGE_VALF\fR evaluates to +infinity on systems
262 supporting IEEE Std 754-1985.
268 \fB\fBHUGE_VALL\fR\fR
271 A positive \fBlong double\fR constant expression. Used as an error value
272 returned by the mathematics library. \fBHUGE_VALL\fR evaluates to +infinity on
273 systems supporting IEEE Std 754-1985.
282 A constant expression of type \fBfloat\fR representing positive or unsigned
283 infinity, if available; else a positive constant of type \fBfloat\fR that
284 overflows at translation time.
293 A constant expression of type float representing a quiet NaN. This symbolic
294 constant is only defined if the implementation supports quiet NaNs for the
300 The following macros are defined for number classification. They represent the
301 mutually-exclusive kinds of floating-point values. They expand to integer
302 constant expressions with distinct values
316 The following optional macros indicate whether the \fBfma()\fR family of
317 functions are fast compared with direct code:
329 The \fBFP_FAST_FMA\fR macro is defined to indicate that the \fBfma()\fR
330 function generally executes about as fast as, or faster than, a multiply and an
331 add of \fBdouble\fR operands. The other macros have the equivalent meaning for
332 the \fBfloat\fR and \fBlong double\fR versions.
335 The following macros expand to integer constant expressions whose values are
336 returned by \fBilogb\fR(\fIx\fR) if \fIx\fR is zero or NaN, respectively. The
337 value of \fBFP_ILOGB0\fR is either {\fBINT_MIN\fR} or -{\fBINT_MAX\fR}. The
338 value of \fBFP_ILOGBNAN\fR is either {\fBINT_MAX\fR} or {\fBINT_MIN\fR}.
349 The following macros expand to the integer constants 1 and 2, respectively:
360 The following macro expands to an expression that has type \fBint\fR and the
361 value \fBMATH_ERREXCEPT\fR:
371 The value of the macro \fBmath_errhandling\fR is constant for the duration of
372 the program. If a macro definition is suppressed or a program defines an
373 identifier with the name \fBmath_errhandling\fR, the behavior is undefined.
376 The <\fBmath.h\fR> header defines he following external variable:
386 The <\fBmath.h\fR> header defines the structure and constants used by the
387 \fBmatherr\fR(3M) error-handling mechanisms.
391 See \fBattributes\fR(5) for descriptions of the following attributes:
399 ATTRIBUTE TYPE ATTRIBUTE VALUE
401 Interface Stability Standard
407 \fBIntro\fR(3), \fBfenv.h\fR(3HEAD), \fBlibm\fR(3LIB), \fBlimits.h\fR(3HEAD),
408 \fBmatherr\fR(3M), \fBattributes\fR(5), \fBstandards\fR(5)