Overview
Python floats are implemented as Cdouble precision floating-point numbers.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Working with Python float type
double precision floating-point numbers.
PyTypeObject PyFloat_Type
int PyFloat_Check(PyObject *p)
int PyFloat_CheckExact(PyObject *p)
PyObject* PyFloat_FromDouble(double v)
PyObject* PyFloat_FromString(PyObject *str)
PyObject *pi = PyFloat_FromDouble(3.14159);
return pi;
double PyFloat_AsDouble(PyObject *pyfloat)
double value = PyFloat_AsDouble(obj);
if (value == -1.0 && PyErr_Occurred())
return NULL;
Py_RETURN_NAN // Return NaN
Py_RETURN_INF(sign) // Return infinity
if (is_invalid(x))
Py_RETURN_NAN;
