aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Python/pystrtod.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2024-02-12 07:53:52 +0300
committershadchin <shadchin@yandex-team.com>2024-02-12 08:07:36 +0300
commitce1b7ca3171f9158180640c6a02a74b4afffedea (patch)
treee47c1e8391b1b0128262c1e9b1e6ed4c8fff2348 /contrib/tools/python3/src/Python/pystrtod.c
parent57350d96f030db90f220ce50ee591d5c5d403df7 (diff)
downloadydb-ce1b7ca3171f9158180640c6a02a74b4afffedea.tar.gz
Update Python from 3.11.8 to 3.12.2
Diffstat (limited to 'contrib/tools/python3/src/Python/pystrtod.c')
-rw-r--r--contrib/tools/python3/src/Python/pystrtod.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/contrib/tools/python3/src/Python/pystrtod.c b/contrib/tools/python3/src/Python/pystrtod.c
index d77b846f04..9bb060e3d1 100644
--- a/contrib/tools/python3/src/Python/pystrtod.c
+++ b/contrib/tools/python3/src/Python/pystrtod.c
@@ -23,44 +23,6 @@ case_insensitive_match(const char *s, const char *t)
return the NaN or Infinity as a double and set *endptr to point just beyond
the successfully parsed portion of the string. On failure, return -1.0 and
set *endptr to point to the start of the string. */
-
-#if _PY_SHORT_FLOAT_REPR == 1
-
-double
-_Py_parse_inf_or_nan(const char *p, char **endptr)
-{
- double retval;
- const char *s;
- int negate = 0;
-
- s = p;
- if (*s == '-') {
- negate = 1;
- s++;
- }
- else if (*s == '+') {
- s++;
- }
- if (case_insensitive_match(s, "inf")) {
- s += 3;
- if (case_insensitive_match(s, "inity"))
- s += 5;
- retval = _Py_dg_infinity(negate);
- }
- else if (case_insensitive_match(s, "nan")) {
- s += 3;
- retval = _Py_dg_stdnan(negate);
- }
- else {
- s = p;
- retval = -1.0;
- }
- *endptr = (char *)s;
- return retval;
-}
-
-#else
-
double
_Py_parse_inf_or_nan(const char *p, char **endptr)
{
@@ -84,7 +46,7 @@ _Py_parse_inf_or_nan(const char *p, char **endptr)
}
else if (case_insensitive_match(s, "nan")) {
s += 3;
- retval = negate ? -Py_NAN : Py_NAN;
+ retval = negate ? -fabs(Py_NAN) : fabs(Py_NAN);
}
else {
s = p;
@@ -94,7 +56,6 @@ _Py_parse_inf_or_nan(const char *p, char **endptr)
return retval;
}
-#endif
/**
* _PyOS_ascii_strtod: