File indexing completed on 2025-03-13 09:20:54
0001 #ifndef Py_CPYTHON_FLOATOBJECT_H
0002 # error "this header file must not be included directly"
0003 #endif
0004
0005 typedef struct {
0006 PyObject_HEAD
0007 double ob_fval;
0008 } PyFloatObject;
0009
0010 #define _PyFloat_CAST(op) \
0011 (assert(PyFloat_Check(op)), _Py_CAST(PyFloatObject*, op))
0012
0013
0014
0015 static inline double PyFloat_AS_DOUBLE(PyObject *op) {
0016 return _PyFloat_CAST(op)->ob_fval;
0017 }
0018 #define PyFloat_AS_DOUBLE(op) PyFloat_AS_DOUBLE(_PyObject_CAST(op))
0019
0020
0021 PyAPI_FUNC(int) PyFloat_Pack2(double x, char *p, int le);
0022 PyAPI_FUNC(int) PyFloat_Pack4(double x, char *p, int le);
0023 PyAPI_FUNC(int) PyFloat_Pack8(double x, char *p, int le);
0024
0025 PyAPI_FUNC(double) PyFloat_Unpack2(const char *p, int le);
0026 PyAPI_FUNC(double) PyFloat_Unpack4(const char *p, int le);
0027 PyAPI_FUNC(double) PyFloat_Unpack8(const char *p, int le);