From: Josh C. <jc...@nc...> - 2009-10-27 19:43:02
|
On Tue, 27 Oct 2009, Robert Johansson wrote: > on the factorial function-example here: > > > > http://swig.svn.sourceforge.net/viewvc/swig/trunk/Doc/Manual/Python.html#Pyt > hon_nn6 > > > > at first it seemed to work out just fine, I got a .pyd file and I can import > example.py and run example.fact(n) for small values of n. However when I try > n=20 I get an integer less than 0. I also tried to compile everything > directly with gcc (not using distutils), but with exactly the same result. I > would be very grateful for suggestions or pointers to more information to > help me out on this. Is it my version of mingw that is to old? It's probably just overflow in the integer arithmetic (32 bits?), in which case it has nothing to do with wrapping or SWIG; you'd get the same result calling it from C. Josh |