diff options
author | Victor Stinner <vstinner@python.org> | 2021-10-14 21:41:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 21:41:06 (GMT) |
commit | 0a883a76cda8205023c52211968bcf87bd47fd6e (patch) | |
tree | 3a540308c72262afb3a750f47df6713410a99d90 /Include/cpython | |
parent | 79cf20e48d0b5d69d9fac2a0204b5ac2c366066a (diff) | |
download | cpython-0a883a76cda8205023c52211968bcf87bd47fd6e.zip cpython-0a883a76cda8205023c52211968bcf87bd47fd6e.tar.gz cpython-0a883a76cda8205023c52211968bcf87bd47fd6e.tar.bz2 |
bpo-35134: Add Include/cpython/floatobject.h (GH-28957)
Split Include/floatobject.h into sub-files: add
Include/cpython/floatobject.h and
Include/internal/pycore_floatobject.h.
Diffstat (limited to 'Include/cpython')
-rw-r--r-- | Include/cpython/floatobject.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Include/cpython/floatobject.h b/Include/cpython/floatobject.h new file mode 100644 index 0000000..fffd468 --- /dev/null +++ b/Include/cpython/floatobject.h @@ -0,0 +1,12 @@ +#ifndef Py_CPYTHON_FLOATOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_HEAD + double ob_fval; +} PyFloatObject; + +// Macro version of PyFloat_AsDouble() trading safety for speed. +// It doesn't check if op is a double object. +#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval) |