~ubuntu-branches/ubuntu/wily/avr-libc/wily-proposed

« back to all changes in this revision

Viewing changes to include/math.h

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2009-10-31 11:52:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20091031115210-crjd42sn6ezrj52c
Tags: 1:1.6.7-1
* New upstream relese (closes: #544030)
* Added lintian overrides (closes: #553265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002,2007 Michael Stumpf
 
1
/* Copyright (c) 2002,2007-2009 Michael Stumpf
2
2
 
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. */
34
34
 
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 $ */
36
36
 
37
37
/*
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.     */
65
65
 
66
 
/**
67
 
   \ingroup avr_math
68
 
 
69
 
   The constant \c pi. */
70
 
#define M_PI 3.141592653589793238462643
71
 
 
72
 
/**
73
 
   \ingroup avr_math
74
 
 
75
 
   The square root of 2. */
76
 
#define M_SQRT2 1.4142135623730950488016887
77
 
 
78
 
/**
79
 
   \ingroup avr_math
80
 
 
81
 
   NAN constant. */
 
66
 
 
67
/** \ingroup avr_math   */
 
68
/*@{*/
 
69
 
 
70
/** The constant \a e.  */
 
71
#define M_E             2.7182818284590452354
 
72
 
 
73
/** The logarithm of the \a e to base 2. */
 
74
#define M_LOG2E         1.4426950408889634074   /* log_2 e */
 
75
 
 
76
/** The logarithm of the \a e to base 10. */
 
77
#define M_LOG10E        0.43429448190325182765  /* log_10 e */
 
78
 
 
79
/** The natural logarithm of the 2.     */
 
80
#define M_LN2           0.69314718055994530942  /* log_e 2 */
 
81
 
 
82
/** The natural logarithm of the 10.    */
 
83
#define M_LN10          2.30258509299404568402  /* log_e 10 */
 
84
 
 
85
/** The constant \a pi. */
 
86
#define M_PI            3.14159265358979323846  /* pi */
 
87
 
 
88
/** The constant \a pi/2.       */
 
89
#define M_PI_2          1.57079632679489661923  /* pi/2 */
 
90
 
 
91
/** The constant \a pi/4.       */
 
92
#define M_PI_4          0.78539816339744830962  /* pi/4 */
 
93
 
 
94
/** The constant \a 1/pi.       */
 
95
#define M_1_PI          0.31830988618379067154  /* 1/pi */
 
96
 
 
97
/** The constant \a 2/pi.       */
 
98
#define M_2_PI          0.63661977236758134308  /* 2/pi */
 
99
 
 
100
/** The constant \a 2/sqrt(pi). */
 
101
#define M_2_SQRTPI      1.12837916709551257390  /* 2/sqrt(pi) */
 
102
 
 
103
/** The square root of 2.       */
 
104
#define M_SQRT2         1.41421356237309504880  /* sqrt(2) */
 
105
 
 
106
/** The constant \a 1/sqrt(2).  */
 
107
#define M_SQRT1_2       0.70710678118654752440  /* 1/sqrt(2) */
 
108
 
 
109
/** NAN constant.       */
82
110
#define NAN     __builtin_nan("")
83
111
 
84
 
/**
85
 
   \ingroup avr_math
86
 
 
87
 
   INFINITY constant. */
 
112
/** INFINITY constant.  */
88
113
#define INFINITY        __builtin_inf()
89
114
 
 
115
/*@}*/
 
116
 
 
117
 
90
118
#ifndef __ATTR_CONST__
91
119
# define __ATTR_CONST__ __attribute__((__const__))
92
120
#endif
137
165
 
138
166
     The modf() function returns the signed fractional part of \a __x.
139
167
     
140
 
     \note
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.
142
171
  */
143
172
extern double modf(double __x, double *__iptr);
144
173
 
159
188
  /**
160
189
     \ingroup avr_math
161
190
 
 
191
     The cbrt() function returns the cube root of \a __x.
 
192
  */
 
193
extern double cbrt(double __x) __ATTR_CONST__;
 
194
 
 
195
  /**
 
196
     \ingroup avr_math
 
197
 
162
198
     The tan() function returns the tangent of \a __x, measured in
163
199
     radians.
164
200
  */
309
345
 
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.
 
348
     
 
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).
312
351
  */
313
352
extern int isinf(double __x) __ATTR_CONST__;
314
353
 
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
384
423
     nonzero value.
385
 
     
386
 
     \note
387
 
     This implementation returns 1 if sign bit is set.
388
424
  */
389
425
extern int signbit (double __x) __ATTR_CONST__;
390
426