Skip to content

Commit e5a4a73

Browse files
committed
Add support to non-short floating point conversion to string
1 parent 3feb308 commit e5a4a73

File tree

9 files changed

+2982
-13
lines changed

9 files changed

+2982
-13
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* Copyright (c) 2023, Oracle and/or its affiliates.
2+
* Copyright (C) 1996-2022 Python Software Foundation
3+
*
4+
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
5+
*/
6+
#ifndef PY_NO_SHORT_FLOAT_REPR
7+
#ifdef __cplusplus
8+
extern "C" {
9+
#endif
10+
11+
#ifndef Py_BUILD_CORE
12+
# error "this header requires Py_BUILD_CORE define"
13+
#endif
14+
15+
/* These functions are used by modules compiled as C extension like math:
16+
they must be exported. */
17+
18+
PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr);
19+
PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
20+
int *decpt, int *sign, char **rve);
21+
PyAPI_FUNC(void) _Py_dg_freedtoa(char *s);
22+
PyAPI_FUNC(double) _Py_dg_stdnan(int sign);
23+
PyAPI_FUNC(double) _Py_dg_infinity(int sign);
24+
25+
#ifdef __cplusplus
26+
}
27+
#endif
28+
#endif /* !PY_NO_SHORT_FLOAT_REPR */

graalpython/com.oracle.graal.python.cext/include/pyconfig.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -145,5 +145,13 @@
145145
#define NT_THREADS 1
146146
#endif
147147

148+
// The following should have been generated using `configure` command,
149+
// but instead, are set manully for the time being.
150+
151+
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
152+
least significant byte first */
153+
#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
154+
155+
148156
#endif /*Py_PYCONFIG_H*/
149157

0 commit comments

Comments
 (0)