Long double in Python

Charles Vejnar charles.vejnar at isb-sib.ch
Fri May 25 15:40:33 EDT 2007


Hi,

I have a C library using "long double" numbers. I would like to be able to 
keep this precision in Python (even if it's not portable) : for the moment I 
have to cast the "long double" numbers to "double" numbers.

1st solution . Is it possible that by re-compiling Python, Python Float object 
becomes "long double" C type instead of "double" ?
2nd solution : Numpy. In memory, a "numpy.longdouble" is a C "long double" or 
a string ?

Thank you.

Charles



More information about the Python-list mailing list