summaryrefslogtreecommitdiff
path: root/Lib/math.i
diff options
context:
space:
mode:
authorDave Beazley <dave-swig@dabeaz.com>2000-01-11 21:15:54 +0000
committerDave Beazley <dave-swig@dabeaz.com>2000-01-11 21:15:54 +0000
commit4e317b85afc493431911890b13022375d8243c47 (patch)
tree3c34045abbc635d4bd23867a21a8ef51c5120918 /Lib/math.i
parent15f2345dcdb0290b1e357249ec18947d0d068b8c (diff)
downloadswig-4e317b85afc493431911890b13022375d8243c47.tar.gz
Added files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@39 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/math.i')
-rw-r--r--Lib/math.i113
1 files changed, 113 insertions, 0 deletions
diff --git a/Lib/math.i b/Lib/math.i
new file mode 100644
index 000000000..bdec05e12
--- /dev/null
+++ b/Lib/math.i
@@ -0,0 +1,113 @@
+//
+// $Header$
+//
+// math.i
+// Dave Beazley
+// March 24, 1996
+// SWIG file for floating point operations
+//
+/* Revision history
+ * $Log$
+ * Revision 1.1 2000/01/11 21:15:48 beazley
+ * Added files
+ *
+ * Revision 1.1.1.1 1999/02/28 02:00:53 beazley
+ * Swig1.1
+ *
+ * Revision 1.1 1996/05/22 17:27:01 beazley
+ * Initial revision
+ *
+ */
+
+%module math
+%{
+#include <math.h>
+%}
+
+%section "SWIG Math Module",after,info,nosort,pre,chop_left=3,chop_bottom=0,chop_top=0,chop_right=0,skip=1
+
+%text %{
+%include math.i
+
+This module provides access to the C math library and contains most
+of the functions in <math.h>. Most scripting languages already provide
+math support, but in certain cases, this module can provide more
+direct access.
+%}
+
+%subsection "Functions"
+
+
+extern double cos(double x);
+/* Cosine of x */
+
+extern double sin(double x);
+/* Sine of x */
+
+extern double tan(double x);
+/* Tangent of x */
+
+extern double acos(double x);
+/* Inverse cosine in range [-PI/2,PI/2], x in [-1,1]. */
+
+extern double asin(double x);
+/* Inverse sine in range [0,PI], x in [-1,1]. */
+
+extern double atan(double x);
+/* Inverse tangent in range [-PI/2,PI/2]. */
+
+extern double atan2(double y, double x);
+/* Inverse tangent of y/x in range [-PI,PI]. */
+
+extern double cosh(double x);
+/* Hyperbolic cosine of x */
+
+extern double sinh(double x);
+/* Hyperbolic sine of x */
+
+extern double tanh(double x);
+/* Hyperbolic tangent of x */
+
+extern double exp(double x);
+/* Natural exponential function e^x */
+
+extern double log(double x);
+/* Natural logarithm ln(x), x > 0 */
+
+extern double log10(double x);
+/* Base 10 logarithm, x > 0 */
+
+extern double pow(double x, double y);
+/* Power function x^y. */
+
+extern double sqrt(double x);
+/* Square root. x >= 0 */
+
+extern double fabs(double x);
+/* Absolute value of x */
+
+extern double ceil(double x);
+/* Smallest integer not less than x, as a double */
+
+extern double floor(double x);
+/* Largest integer not greater than x, as a double */
+
+extern double fmod(double x, double y);
+/* Floating-point remainder of x/y, with the same sign as x. */
+
+%subsection "Mathematical constants",noinfo
+
+#define M_E 2.7182818284590452354
+#define M_LOG2E 1.4426950408889634074
+#define M_LOG10E 0.43429448190325182765
+#define M_LN2 0.69314718055994530942
+#define M_LN10 2.30258509299404568402
+#define M_PI 3.14159265358979323846
+#define M_PI_2 1.57079632679489661923
+#define M_PI_4 0.78539816339744830962
+#define M_1_PI 0.31830988618379067154
+#define M_2_PI 0.63661977236758134308
+#define M_2_SQRTPI 1.12837916709551257390
+#define M_SQRT2 1.41421356237309504880
+#define M_SQRT1_2 0.70710678118654752440
+