diff options
Diffstat (limited to 'numpy/distutils/tests/swig_ext/src/example.c')
-rw-r--r-- | numpy/distutils/tests/swig_ext/src/example.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/numpy/distutils/tests/swig_ext/src/example.c b/numpy/distutils/tests/swig_ext/src/example.c new file mode 100644 index 000000000..7bbb661dd --- /dev/null +++ b/numpy/distutils/tests/swig_ext/src/example.c @@ -0,0 +1,14 @@ +/* File : example.c */ + +double My_variable = 3.0; + +/* Compute factorial of n */ +int fact(int n) { + if (n <= 1) return 1; + else return n*fact(n-1); +} + +/* Compute n mod m */ +int my_mod(int n, int m) { + return(n % m); +} |