2021-10-14 18:41:06 -03:00
|
|
|
#ifndef Py_INTERNAL_FLOATOBJECT_H
|
|
|
|
#define Py_INTERNAL_FLOATOBJECT_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef Py_BUILD_CORE
|
|
|
|
# error "this header requires Py_BUILD_CORE define"
|
|
|
|
#endif
|
|
|
|
|
2023-07-03 05:23:43 -03:00
|
|
|
#include "pycore_unicodeobject.h" // _PyUnicodeWriter
|
|
|
|
|
2021-12-09 15:59:26 -04:00
|
|
|
/* runtime lifecycle */
|
|
|
|
|
|
|
|
extern void _PyFloat_InitState(PyInterpreterState *);
|
|
|
|
extern PyStatus _PyFloat_InitTypes(PyInterpreterState *);
|
2022-01-20 20:42:25 -04:00
|
|
|
extern void _PyFloat_FiniType(PyInterpreterState *);
|
2021-12-09 15:59:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
/* other API */
|
|
|
|
|
2022-11-16 12:37:14 -04:00
|
|
|
enum _py_float_format_type {
|
|
|
|
_py_float_format_unknown,
|
|
|
|
_py_float_format_ieee_big_endian,
|
|
|
|
_py_float_format_ieee_little_endian,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Py_float_runtime_state {
|
|
|
|
enum _py_float_format_type float_format;
|
|
|
|
enum _py_float_format_type double_format;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-09 15:59:26 -04:00
|
|
|
|
|
|
|
|
2024-02-29 12:11:28 -04:00
|
|
|
PyAPI_FUNC(void) _PyFloat_ExactDealloc(PyObject *op);
|
2022-04-19 15:02:19 -03:00
|
|
|
|
2021-10-14 18:41:06 -03:00
|
|
|
|
2023-07-24 22:44:11 -03:00
|
|
|
extern void _PyFloat_DebugMallocStats(FILE* out);
|
2021-10-14 18:41:06 -03:00
|
|
|
|
|
|
|
|
|
|
|
/* Format the object based on the format_spec, as defined in PEP 3101
|
|
|
|
(Advanced String Formatting). */
|
2023-07-24 22:44:11 -03:00
|
|
|
extern int _PyFloat_FormatAdvancedWriter(
|
2021-10-14 18:41:06 -03:00
|
|
|
_PyUnicodeWriter *writer,
|
|
|
|
PyObject *obj,
|
|
|
|
PyObject *format_spec,
|
|
|
|
Py_ssize_t start,
|
|
|
|
Py_ssize_t end);
|
|
|
|
|
2023-08-24 14:09:49 -03:00
|
|
|
extern PyObject* _Py_string_to_number_with_underscores(
|
|
|
|
const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
|
|
|
|
PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
|
|
|
|
|
|
|
|
extern double _Py_parse_inf_or_nan(const char *p, char **endptr);
|
|
|
|
|
|
|
|
|
2021-10-14 18:41:06 -03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_INTERNAL_FLOATOBJECT_H */
|