Objetos de punto flotante

type PyFloatObject

Este subtipo de PyObject representa un objeto de punto flotante de Python.

PyTypeObject PyFloat_Type
Part of the Stable ABI.

Esta instancia de PyTypeObject representa el tipo de punto flotante de Python. Este es el mismo objeto que float en la capa de Python.

int PyFloat_Check(PyObject *p)

Retorna verdadero si su argumento es un PyFloatObject o un subtipo de PyFloatObject. Esta función siempre finaliza con éxito.

int PyFloat_CheckExact(PyObject *p)

Retorna verdadero si su argumento es un PyFloatObject, pero no un subtipo de PyFloatObject. Esta función siempre finaliza con éxito.

PyObject *PyFloat_FromString(PyObject *str)
Return value: New reference. Part of the Stable ABI.

Crea un objeto PyFloatObject en función del valor de cadena de caracteres en str o NULL en caso de error.

PyObject *PyFloat_FromDouble(double v)
Return value: New reference. Part of the Stable ABI.

Crea un objeto PyFloatObject a partir de v, o NULL en caso de error.

double PyFloat_AsDouble(PyObject *pyfloat)
Part of the Stable ABI.

Return a C double representation of the contents of pyfloat. If pyfloat is not a Python floating point object but has a __float__() method, this method will first be called to convert pyfloat into a float. If __float__() is not defined then it falls back to __index__(). This method returns -1.0 upon failure, so one should call PyErr_Occurred() to check for errors.

Distinto en la versión 3.8: Utilice __index__() si está disponible.

double PyFloat_AS_DOUBLE(PyObject *pyfloat)

Return a C double representation of the contents of pyfloat, but without error checking.

PyObject *PyFloat_GetInfo(void)
Return value: New reference. Part of the Stable ABI.

Retorna una instancia de structseq que contiene información sobre la precisión, los valores mínimos y máximos de un flotante. Es una envoltura delgada alrededor del archivo de encabezado float.h.

double PyFloat_GetMax()
Part of the Stable ABI.

Return the maximum representable finite float DBL_MAX as C double.

double PyFloat_GetMin()
Part of the Stable ABI.

Return the minimum normalized positive float DBL_MIN as C double.