[issue43177] How to use `long double` as a PyObject?

Mark Dickinson report at bugs.python.org
Tue Feb 9 09:33:47 EST 2021


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Any plans to add it in the future?

It depends - it's not really clear to me what you're asking for.

If you just want to get a Python `float` from a C long double, then cast to double in the C code and then use `PyFloat_FromDouble`. Obviously that loses any extra precision that the C long double had.

If you're asking for Python to grow a new type of "float" with long double precision, that's a *much* bigger ask, and realistically it's not going to happen in the forseeable future.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43177>
_______________________________________


More information about the Python-bugs-list mailing list