1
/* Copyright (c) 2002,2007 Michael Stumpf
1
/* Copyright (c) 2002,2007-2009 Michael Stumpf
3
3
Portions of documentation Copyright (c) 1990 - 1994
4
4
The Regents of the University of California.
32
32
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
33
POSSIBILITY OF SUCH DAMAGE. */
35
/* $Id: math.h,v 1.21.2.2 2008/04/10 13:39:16 arcanum Exp $ */
35
/* $Id: math.h,v 1.21.2.5 2009/06/28 06:07:08 dmix Exp $ */
38
38
math.h - mathematical functions
63
63
\c errno variable. Therefore the majority of them are declared
64
64
with const attribute, for better optimization by GCC. */
69
The constant \c pi. */
70
#define M_PI 3.141592653589793238462643
75
The square root of 2. */
76
#define M_SQRT2 1.4142135623730950488016887
67
/** \ingroup avr_math */
70
/** The constant \a e. */
71
#define M_E 2.7182818284590452354
73
/** The logarithm of the \a e to base 2. */
74
#define M_LOG2E 1.4426950408889634074 /* log_2 e */
76
/** The logarithm of the \a e to base 10. */
77
#define M_LOG10E 0.43429448190325182765 /* log_10 e */
79
/** The natural logarithm of the 2. */
80
#define M_LN2 0.69314718055994530942 /* log_e 2 */
82
/** The natural logarithm of the 10. */
83
#define M_LN10 2.30258509299404568402 /* log_e 10 */
85
/** The constant \a pi. */
86
#define M_PI 3.14159265358979323846 /* pi */
88
/** The constant \a pi/2. */
89
#define M_PI_2 1.57079632679489661923 /* pi/2 */
91
/** The constant \a pi/4. */
92
#define M_PI_4 0.78539816339744830962 /* pi/4 */
94
/** The constant \a 1/pi. */
95
#define M_1_PI 0.31830988618379067154 /* 1/pi */
97
/** The constant \a 2/pi. */
98
#define M_2_PI 0.63661977236758134308 /* 2/pi */
100
/** The constant \a 2/sqrt(pi). */
101
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
103
/** The square root of 2. */
104
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
106
/** The constant \a 1/sqrt(2). */
107
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
82
110
#define NAN __builtin_nan("")
112
/** INFINITY constant. */
88
113
#define INFINITY __builtin_inf()
90
118
#ifndef __ATTR_CONST__
91
119
# define __ATTR_CONST__ __attribute__((__const__))
138
166
The modf() function returns the signed fractional part of \a __x.
141
This implementation skips writing by zero pointer.
168
\note This implementation skips writing by zero pointer. However,
169
the GCC 4.3 can replace this function with inline code that does not
170
permit to use NULL address for the avoiding of storing.
143
172
extern double modf(double __x, double *__iptr);
310
346
The function isinf() returns 1 if the argument \a __x is positive
311
347
infinity, -1 if \a __x is negative infinity, and 0 otherwise.
349
\note The GCC 4.3 can replace this function with inline code that
350
returns the 1 value for both infinities (gcc bug #35509).
313
352
extern int isinf(double __x) __ATTR_CONST__;
382
421
because IEEE 754 floating point allows zero to be signed. The
383
422
comparison `-0.0 < 0.0' is false, but `signbit (-0.0)' will return a
387
This implementation returns 1 if sign bit is set.
389
425
extern int signbit (double __x) __ATTR_CONST__;