PageRenderTime 25ms CodeModel.GetById 21ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Lib/math.i

#
Swig | 82 lines | 36 code | 22 blank | 24 comment | 0 complexity | 315fcf465d3a714c05a1bff7e47d5855 MD5 | raw file
 1/* -----------------------------------------------------------------------------
 2 * math.i
 3 *
 4 * SWIG library file for floating point operations.
 5 * ----------------------------------------------------------------------------- */
 6
 7%module math
 8%{
 9#include <math.h>
10%}
11
12extern double	cos(double x);
13/* Cosine of x */
14
15extern double	sin(double x);
16/* Sine of x */
17
18extern double	tan(double x);
19/* Tangent of x */
20
21extern double	acos(double x);
22/* Inverse cosine in range [-PI/2,PI/2], x in [-1,1]. */
23
24extern double	asin(double x);
25/* Inverse sine in range [0,PI], x in [-1,1]. */
26
27extern double	atan(double x);
28/* Inverse tangent in range [-PI/2,PI/2]. */
29
30extern double	atan2(double y, double x);
31/* Inverse tangent of y/x in range [-PI,PI]. */
32
33extern double	cosh(double x);
34/* Hyperbolic cosine of x */
35
36extern double	sinh(double x);
37/* Hyperbolic sine of x */
38
39extern double	tanh(double x);
40/* Hyperbolic tangent of x */
41
42extern double	exp(double x);
43/* Natural exponential function e^x */
44
45extern double	log(double x);
46/* Natural logarithm ln(x), x > 0 */
47
48extern double	log10(double x);
49/* Base 10 logarithm, x > 0 */
50
51extern double	pow(double x, double y);
52/* Power function x^y. */
53
54extern double	sqrt(double x);
55/* Square root. x >= 0 */
56
57extern double	fabs(double x);
58/* Absolute value of x */
59
60extern double	ceil(double x);
61/* Smallest integer not less than x, as a double */
62
63extern double	floor(double x);
64/* Largest integer not greater than x, as a double */
65
66extern double	fmod(double x, double y);
67/* Floating-point remainder of x/y, with the same sign as x. */
68
69#define M_E		2.7182818284590452354
70#define M_LOG2E		1.4426950408889634074
71#define M_LOG10E	0.43429448190325182765
72#define M_LN2		0.69314718055994530942
73#define M_LN10		2.30258509299404568402
74#define M_PI		3.14159265358979323846
75#define M_PI_2		1.57079632679489661923
76#define M_PI_4		0.78539816339744830962
77#define M_1_PI		0.31830988618379067154
78#define M_2_PI		0.63661977236758134308
79#define M_2_SQRTPI	1.12837916709551257390
80#define M_SQRT2		1.41421356237309504880
81#define M_SQRT1_2	0.70710678118654752440
82