File: math.h

package info (click to toggle)
avr-libc 20020203-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,448 kB
  • ctags: 6,562
  • sloc: ansic: 7,631; asm: 4,424; sh: 2,703; makefile: 338; pascal: 289
file content (68 lines) | stat: -rw-r--r-- 1,951 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
   math.h - mathematical functions

   Author : Michael Stumpf
            Michael.Stumpf@t-online.de

   __ATTR_CONST__ added by marekm@linux.org.pl for functions
   that "do not examine any values except their arguments, and have
   no effects except the return value", for better optimization by gcc.
 */

#ifndef __MATH_H
#define __MATH_H

#define M_PI 3.141592653589793238462643
#define M_SQRT2 1.4142135623730950488016887

#ifndef __ATTR_CONST__
#define __ATTR_CONST__ __attribute__((__const__))
#endif

#ifdef __cplusplus
extern "C" {
#endif
	
extern double cos(double) __ATTR_CONST__;
extern double fabs(double) __ATTR_CONST__;
#if 0
/* fabs seems to be built in already */
extern inline double fabs( double __x )
  { double __res;
    __asm__ __volatile__ ("andi %D0,0x7F \n\t"
		: "=d" (__res) : "0" (__x) );
    return __res;
  }
#endif
extern double fmod(double, double) __ATTR_CONST__;
extern double modf(double, double *);
extern double sin(double) __ATTR_CONST__;
extern double sqrt(double) __ATTR_CONST__;
extern double tan(double) __ATTR_CONST__;
extern double floor(double) __ATTR_CONST__;
extern double ceil(double) __ATTR_CONST__;
extern double frexp(double, int *);
extern double ldexp(double,int) __ATTR_CONST__;
extern double exp(double) __ATTR_CONST__;
extern double cosh(double) __ATTR_CONST__;
extern double sinh(double) __ATTR_CONST__;
extern double tanh(double) __ATTR_CONST__;
extern double acos(double) __ATTR_CONST__;
extern double asin(double) __ATTR_CONST__;
extern double atan(double) __ATTR_CONST__;
extern double atan2(double, double) __ATTR_CONST__;
extern double log(double) __ATTR_CONST__;
extern double log10(double) __ATTR_CONST__;
extern double pow(double, double) __ATTR_CONST__;
extern double strtod(const char *s, char **endptr);

/* non-standard functions */
extern double square(double) __ATTR_CONST__;
extern double inverse(double) __ATTR_CONST__;

#ifdef __cplusplus
}
#endif

#endif /* _MATH_H */