Objek Pecahan¶
-
PyTypeObject
PyFloat_Type¶ - Part of the Stable ABI.
Instance dari
PyTypeObjectini mewakili tipe pecahan Python. Ini adalah objek yang sama denganfloatdi lapisan Python.
-
int
PyFloat_Check(PyObject *p)¶ Mengambalikan nilai true jika argumennya adalah
PyFloatObjectatau subtipe dariPyFloatObject. Fungsi ini selalu sukses.
-
int
PyFloat_CheckExact(PyObject *p)¶ Mengambalikan nilai true jika argumennya adalah
PyFloatObject, tetapi bukan subtipe dariPyFloatObject.
-
PyObject *
PyFloat_FromString(PyObject *str)¶ - Return value: New reference. Part of the Stable ABI.
Membuat objek
PyFloatObjectberdasarkan nilai string di str, atauNULLjika gagal.
-
PyObject *
PyFloat_FromDouble(double v)¶ - Return value: New reference. Part of the Stable ABI.
Membuat objek
PyFloatObjectdari v, atauNULLjika gagal.
-
double
PyFloat_AsDouble(PyObject *pyfloat)¶ - Part of the Stable ABI.
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. If__float__()is not defined then it falls back to__index__(). This method returns-1.0upon failure, so one should callPyErr_Occurred()to check for errors.Berubah pada versi 3.8: Gunakan
__index__()jika tersedia.
-
double
PyFloat_AS_DOUBLE(PyObject *pyfloat)¶ Return a C
doublerepresentation of the contents of pyfloat, but without error checking.
-
PyObject *
PyFloat_GetInfo(void)¶ - Return value: New reference. Part of the Stable ABI.
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()¶ - 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.