Objetos de ponto flutuante¶
-
PyTypeObject
PyFloat_Type¶ - Part of the Stable ABI.
Esta instância do
PyTypeObjectrepresenta o tipo de ponto flutuante do Python. Este é o mesmo objetofloatna camada do Python.
-
int
PyFloat_Check(PyObject *p)¶ Retorna true se seu argumento é um
PyFloatObjectou um subtipo dePyFloatObject. Esta função sempre tem sucesso.
-
int
PyFloat_CheckExact(PyObject *p)¶ Retorna true se seu argumento é um
PyFloatObject, mas um subtipo dePyFloatObject. Esta função sempre tem sucesso.
-
PyObject *
PyFloat_FromString(PyObject *str)¶ - Retorna valor: Nova referência. Part of the Stable ABI.
Cria um objeto
PyFloatObjectbaseado em uma string de valor “str” ouNULLem falha.
-
PyObject *
PyFloat_FromDouble(double v)¶ - Retorna valor: Nova referência. Part of the Stable ABI.
Cria um objeto
PyFloatObjectde v ouNULLem falha.
-
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.Alterado na versão 3.8: Usa
__index__(), se disponível.
-
double
PyFloat_AS_DOUBLE(PyObject *pyfloat)¶ Retorna uma representação C
doubledo conteúdo de pyfloat, mas sem verificação de erro.
-
PyObject *
PyFloat_GetInfo(void)¶ - Retorna valor: Nova referência. Part of the Stable ABI.
Retorna uma instância de structseq que contém informações sobre a precisão, os valores mínimo e máximo de um ponto flutuante. É um invólucro fino em torno do arquivo de cabeçalho
float.h.
-
double
PyFloat_GetMax()¶ - Part of the Stable ABI.
Retorna o ponto flutuante finito máximo representável DBL_MAX como
doubledo C.
-
double
PyFloat_GetMin()¶ - Part of the Stable ABI.
Retorna o ponto flutuante positivo mínimo normalizado DBL_MIN como
doubledo C.