PyFloat_AsDouble C/API function

Alex Martelli aleax at aleax.it
Mon Mar 31 09:02:58 EST 2003


<posted & mailed>

Kostyantyn Teplynskyy wrote:

> 
> Hellow, can somebody explain me why PyFloat_AsDouble converts only to 3
> decimal places. Example

It does nothing of the kind -- the symptom you report is no doubt partly
mis-observation on your part (e.g., you're seeing "6 signigicant digits"
and erroneously believing it matters at all which of those digits are
"decimal places") and partly due to some OTHER part of your C code that
you don't show us.  For example, if you were at any time converting that
C double into a C float (single-precision, thus about 6 significant
digits) that might explain things.  But the PyFloat_AsDouble C/API
function, per se, has nothing to do with the problem you see.


Alex





More information about the Python-list mailing list