return TRUE;
}
-#ifndef USE_QUADMATH
+#ifndef Perl_strtod
STATIC NV
S_mulexp10(NV value, I32 exponent)
{
}
return negative ? value / result : value * result;
}
-#endif /* #ifndef USE_QUADMATH */
+#endif /* #ifndef Perl_strtod */
-#ifdef USE_QUADMATH
+#ifdef Perl_strtod
# define ATOF(s, x) my_atof2(s, &x)
-# else
+#else
# define ATOF(s, x) Perl_atof2(s, x)
-# endif
+#endif
NV
Perl_my_atof(pTHX_ const char* s)
{
DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
STORE_LC_NUMERIC_SET_TO_NEEDED();
- if (PL_numeric_radix_sv && IN_LC(LC_NUMERIC)) {
+ if (! (PL_numeric_radix_sv && IN_LC(LC_NUMERIC))) {
+ ATOF(s,x);
+ }
+ else {
/* Look through the string for the first thing that looks like a
* decimal point: either the value in the current locale or the
SET_NUMERIC_UNDERLYING();
}
}
- else {
- ATOF(s,x);
- }
RESTORE_LC_NUMERIC();
}
{
const char* s = orig;
NV result[3] = {0.0, 0.0, 0.0};
-#if defined(USE_PERL_ATOF) || defined(USE_QUADMATH)
+#if defined(USE_PERL_ATOF) || defined(Perl_strtod)
const char* send = s + ((len != 0)
? len
: strlen(orig)); /* one past the last */
bool negative = 0;
#endif
-#if defined(USE_PERL_ATOF) && !defined(USE_QUADMATH)
+#if defined(USE_PERL_ATOF) && !defined(Perl_strtod)
UV accumulator[2] = {0,0}; /* before/after dp */
bool seen_digit = 0;
I32 exp_adjust[2] = {0,0};
I32 sig_digits = 0; /* noof significant digits seen so far */
#endif
-#if defined(USE_PERL_ATOF) || defined(USE_QUADMATH)
+#if defined(USE_PERL_ATOF) || defined(Perl_strtod)
PERL_ARGS_ASSERT_MY_ATOF3;
/* leading whitespace */
}
#endif
-#ifdef USE_QUADMATH
+#ifdef Perl_strtod
{
char* endp;
char* copy = NULL;
s = copy + (s - orig);
}
- result[2] = strtoflt128(s, &endp);
+ result[2] = Perl_strtod(s, &endp);
/* If we created a copy, 'endp' is in terms of that. Convert back to
* the original */
if (copy) {
+ s = (s - copy) + (char *) orig;
endp = (endp - copy) + (char *) orig;
Safefree(copy);
}