Objek Pecahan

PyFloatObject

Subtipe dari PyObject ini mewakili objek pecahan Python.

PyTypeObject PyFloat_Type

Instance dari PyTypeObject ini mewakili tipe pecahan Python. Ini adalah objek yang sama dengan float di lapisan Python.

int PyFloat_Check(PyObject *p)

Return true if its argument is a PyFloatObject or a subtype of PyFloatObject.

int PyFloat_CheckExact(PyObject *p)

Return true if its argument is a PyFloatObject, but not a subtype of PyFloatObject.

PyObject* PyFloat_FromString(PyObject *str)
Return value: New reference.

Create a PyFloatObject object based on the string value in str, or NULL on failure.

PyObject* PyFloat_FromDouble(double v)
Return value: New reference.

Create a PyFloatObject object from v, or NULL on failure.

double PyFloat_AsDouble(PyObject *pyfloat)

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. This method returns -1.0 upon failure, so one should call PyErr_Occurred() to check for errors.

double PyFloat_AS_DOUBLE(PyObject *pyfloat)

Mengembalikan representasi C double dari konten pyfloat, tetapi tanpa pemeriksaan error.

PyObject* PyFloat_GetInfo(void)

Mengembalikan instance structseq yang berisi informasi tentang presisi, nilai minimum dan maksimum float. Ini adalah pembungkus tipis di sekitar file header float.h.

double PyFloat_GetMax()

Mengembalikan float maksimum yang dapat direpresentasikan DBL_MAX sebagai C double.

double PyFloat_GetMin()

Mengembalikan float positif minimum yang dinormalisasi DBL_MIN sebagai C double.

int PyFloat_ClearFreeList()

Clear the float free list. Return the number of items that could not be freed.