summaryrefslogtreecommitdiff
path: root/numpy/distutils/tests/swig_ext/src/example.c
blob: be151725ce7f77c16079443039fd5983800eba06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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);
}