New module (written in C) for using the high-precision QD library

baruchel at baruchel at
Sat Aug 1 12:07:48 CEST 2015

Hi, Thank you for your answer.

Actually this is the third version I am writing for using the QD library; the first onPython using ctypes; the second one was in Cython; this one is in C. I don't claim being a Cython expert and maybe my Cython code was not optimal but I can say the C version is significantly quicker (and the binary is about half the size of the Cython binary).

I admit Cython is a great idea but for this very specific project I like rather using C: behind the scene thre is no need to interact with Python; data only relies on elementary C types, etc. I decided to migrate from Cython to C when I realized that I was merely embedding C in Cython almost all the time. Furthermore, the QD library is old, stable and simple. Once my module will be ready it won't evolve much; thus maintaining the project shouldn't be an issue.

I am using Python 2 with the people I am working with and I release my work as it; maybe I will rewrite it for Python 3 one day but it is not my immediate purpose.

Last day I started implementing the new type as dtype for Numpy; for the moment, I disabled this part in the code (because it is far to be really usable) but it can already be tried for having a short glance by uncommenting one line in the code. Best regards. tb.

More information about the Python-list mailing list