Floating Point Objects
-
PyFloatObject This subtype of
PyObjectrepresents a Python floating point object.
-
PyTypeObject
PyFloat_Type This instance of
PyTypeObjectrepresents the Python floating point type. This is the same object asfloatin the Python layer.
-
int
PyFloat_Check(PyObject*p) Return true if its argument is a
PyFloatObjector a subtype ofPyFloatObject.
-
int
PyFloat_CheckExact(PyObject*p) Return true if its argument is a
PyFloatObject, but not a subtype ofPyFloatObject.
-
PyObject*
PyFloat_FromString(PyObject*str) - Return value: New reference.
Create a
PyFloatObjectobject based on the string value in str, or NULL on failure.
-
PyObject*
PyFloat_FromDouble(doublev) - Return value: New reference.
Create a
PyFloatObjectobject from v, or NULL on failure.
-
double
PyFloat_AsDouble(PyObject*pyfloat) Return a C
doublerepresentation 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. This method returns-1.0upon failure, so one should callPyErr_Occurred()to check for errors.
-
double
PyFloat_AS_DOUBLE(PyObject*pyfloat) Return a C
doublerepresentation of the contents of pyfloat, but without error checking.
-
PyObject*
PyFloat_GetInfo(void) Return a structseq instance which contains information about the precision, minimum and maximum values of a float. Its a thin wrapper around the header file
float.h.