summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_dtoa.h
blob: 0f61e7514085868dd6f84af1c320f031829e7d2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef PY_NO_SHORT_FLOAT_REPR
#ifndef Py_INTERNAL_DTOA_H
#define Py_INTERNAL_DTOA_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
#  error "this header requires Py_BUILD_CORE define"
#endif

/* These functions are used by modules compiled as C extension like math:
   they must be exported. */

PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr);
PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
                        int *decpt, int *sign, char **rve);
PyAPI_FUNC(void) _Py_dg_freedtoa(char *s);
PyAPI_FUNC(double) _Py_dg_stdnan(int sign);
PyAPI_FUNC(double) _Py_dg_infinity(int sign);

#define _PyDtoa_Kmax 7

typedef uint32_t _PyDtoa_ULong;
typedef int32_t _PyDtoa_Long;
typedef uint64_t _PyDtoa_ULLong;

struct
_PyDtoa_Bigint {
    struct _PyDtoa_Bigint *next;
    int k, maxwds, sign, wds;
    _PyDtoa_ULong x[1];
};

#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_DTOA_H */
#endif   /* !PY_NO_SHORT_FLOAT_REPR */