summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-08-31 04:26:23 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-31 04:26:23 +0000
commitebd4816b80e45b053b1e4c5e7ff68fe4dcfcd7c8 (patch)
tree47ee05eab89c0f14582cc0220068a55586f1cba2 /util.c
parent971f4bf107c4114680b92221b21d1da9ec393811 (diff)
downloadperl-ebd4816b80e45b053b1e4c5e7ff68fe4dcfcd7c8.tar.gz
sscanf() may be the only way to read long doubles from strings.
p4raw-id: //depot/perl@6937
Diffstat (limited to 'util.c')
-rw-r--r--util.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/util.c b/util.c
index 16f3e02ee9..ea0778f801 100644
--- a/util.c
+++ b/util.c
@@ -3875,23 +3875,24 @@ Perl_my_fflush_all(pTHX)
NV
Perl_my_atof(pTHX_ const char* s)
{
+ NV x = 0.0;
#ifdef USE_LOCALE_NUMERIC
if ((PL_hints & HINT_LOCALE) && PL_numeric_local) {
- NV x, y;
+ NV y;
- x = Perl_atof(s);
+ Perl_atof2(s, x);
SET_NUMERIC_STANDARD();
- y = Perl_atof(s);
+ Perl_atof2(s, y);
SET_NUMERIC_LOCAL();
if ((y < 0.0 && y < x) || (y > 0.0 && y > x))
return y;
- return x;
}
else
- return Perl_atof(s);
+ Perl_atof2(s, x);
#else
- return Perl_atof(s);
+ Perl_atof2(s, x);
#endif
+ return x;
}
void