Search Results

Search found 3 results on 1 pages for 'fibo nacci'.

Page 1/1 | 1 

  • Python c_types .dll functions (pari library)

    - by silinter
    Alright, so a couple days ago I decided to try and write a primitive wrapper for the PARI library. Ever since then I've been playing with ctypes library in loading the dll and accessing the functions contained using code similar to the following: from ctypes import * libcyg=CDLL("<path/cygwin1.dll") #It needs cygwin to be loaded. Not sure why. pari=CDLL("<path>/libpari-gmp-2.4.dll") print pari.fibo #fibonacci function #prints something like "<_FuncPtr object at 0x00BA5828>" So the functions are there and they can potentially be accessed, but I always recieve an access violation no matter what I try. For example: pari.fibo(5) #access violation pari.fibo(c_int(5)) #access violation pari.fibo.argtypes=[c_long] #setting arguments manually pari.fibo.restype=long #set the return type pari.fibo(byref(c_int(5))) #access violation reading 0x04 consistently and any variation on that, including setting argtypes to receive pointers. The Pari .dll is written in C and the fibonacci function's syntax within the library is GEN fibo(long x) (docs @http://pari.math.u-bordeaux.fr/dochtml/html/Arithmetic_functions.html#fibonacci, I need more rep it seems). Could it be the return type that's causing these errors, as it is not a standard int or long but a GEN type, which is unique to the PARI library? Any help would be appreciated. If anyone is able to successfully load the library and use ANY function from within python, please tell; I've been at this for hours now.

    Read the article

  • Where can I find free simple 3D models? [duplicate]

    - by fibo-Nacci
    This question is an exact duplicate of: What are good sites that provide free media resources for hobby game development? [closed] I'm learning OpenGL. Unfortunately can't create 3D models, but I would like to write some really simple games, to improve my programming skills. I need some really basic .obj file, which has one bmp, or jpeg texture. Where can I download some for free? Thanks in advance,

    Read the article

  • How do I implement a fibonacci sequence in java using try/catch logic?

    - by Lars Flyger
    I know how to do it using simple recursion, but in order to complete this particular assignment I need to be able to accumulate on the stack and throw an exception that holds the answer in it. So far I have: public static int fibo(int index) { int sum = 0; try { fibo_aux(index, 1, 1); } catch (IntegerException me) { sum = me.getIntValue(); } return sum; } fibo_aux is supposed to throw an IntegerException (which holds the value of the answer that is retireved via getIntValue) and accumulates the answer on the stack, but so far I can't figure it out. Can anyone help?

    Read the article

1