OSDN Git Service

svn rev.329より移動。
[chnosproject/CHNOSProject.git] / CHNOSProject / chnos / tolset_chn_000 / z_tools / guigui00 / math.h
diff --git a/CHNOSProject/chnos/tolset_chn_000/z_tools/guigui00/math.h b/CHNOSProject/chnos/tolset_chn_000/z_tools/guigui00/math.h
new file mode 100644 (file)
index 0000000..9df151a
--- /dev/null
@@ -0,0 +1,42 @@
+/* copyright(C) 2003 H.Kawai (under KL-01). */\r
+\r
+#if (!defined(MATH_H))\r
+\r
+#define MATH_H 1\r
+\r
+#if (defined(__cplusplus))\r
+       extern "C" {\r
+#endif\r
+\r
+double sin(double);\r
+double cos(double);\r
+double sqrt(double);\r
+double ldexp(double x, int n);\r
+double frexp(double x, int *exp);\r
+\r
+extern __inline__ double sin(double x)\r
+{\r
+       double res;\r
+       __asm__ ("fsin" : "=t" (res) : "0" (x));\r
+       return res;\r
+}\r
+\r
+extern __inline__ double cos(double x)\r
+{\r
+       double res;\r
+       __asm__ ("fcos" : "=t" (res) : "0" (x));\r
+       return res;\r
+}\r
+\r
+extern __inline__ double sqrt(double x)\r
+{\r
+       double res;\r
+       __asm__ ("fsqrt" : "=t" (res) : "0" (x));\r
+       return res;\r
+}\r
+\r
+#if (defined(__cplusplus))\r
+       }\r
+#endif\r
+\r
+#endif\r