OSDN Git Service

svn rev.329より移動。
[chnosproject/CHNOSProject.git] / CHNOSProject / chnos / tolset_chn_000 / z_tools / CHNOSProject / math.h
1 /* copyright(C) 2003 H.Kawai (under KL-01). */\r
2 \r
3 #if (!defined(MATH_H))\r
4 \r
5 #define MATH_H  1\r
6 \r
7 #if (defined(__cplusplus))\r
8         extern "C" {\r
9 #endif\r
10 \r
11 double sin(double);\r
12 double cos(double);\r
13 double sqrt(double);\r
14 double ldexp(double x, int n);\r
15 double frexp(double x, int *exp);\r
16 \r
17 extern __inline__ double sin(double x)\r
18 {\r
19         double res;\r
20         __asm__ ("fsin" : "=t" (res) : "0" (x));\r
21         return res;\r
22 }\r
23 \r
24 extern __inline__ double cos(double x)\r
25 {\r
26         double res;\r
27         __asm__ ("fcos" : "=t" (res) : "0" (x));\r
28         return res;\r
29 }\r
30 \r
31 extern __inline__ double sqrt(double x)\r
32 {\r
33         double res;\r
34         __asm__ ("fsqrt" : "=t" (res) : "0" (x));\r
35         return res;\r
36 }\r
37 \r
38 #if (defined(__cplusplus))\r
39         }\r
40 #endif\r
41 \r
42 #endif\r