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