8 #ifndef Py_FLOATOBJECT_H
9 #define Py_FLOATOBJECT_H
21 #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
22 #define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type)
28 #define PyFloat_STR_PRECISION 12
31 #define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN)
34 #define Py_RETURN_INF(sign) do \
35 if (copysign(1., sign) == 1.) { \
36 return PyFloat_FromDouble(Py_HUGE_VAL); \
38 return PyFloat_FromDouble(-Py_HUGE_VAL); \
51 PyAPI_FUNC(PyObject *) PyFloat_FromDouble(
double);
55 PyAPI_FUNC(
double) PyFloat_AsDouble(PyObject *);
56 #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
104 PyAPI_FUNC(
int) _PyFloat_Pack8(
double x,
unsigned char *p,
int le);
118 PyAPI_FUNC(
double) _PyFloat_Unpack4(const
unsigned char *p,
int le);
119 PyAPI_FUNC(
double) _PyFloat_Unpack8(const
unsigned char *p,
int le);
126 PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *
obj,