# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Aug 30 16:44:38 EET DST 2000 [metaconfig 3.0 PL70]
+# Generated on Thu Aug 31 07:18:29 EET DST 2000 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >/tmp/c1$$ <<EOF
d_PRIeldbl=''
d_PRIfldbl=''
d_PRIgldbl=''
+d_SCNfldbl=''
sPRIEldbl=''
sPRIFldbl=''
sPRIGldbl=''
sPRIeldbl=''
sPRIfldbl=''
sPRIgldbl=''
+sSCNfldbl=''
lseeksize=''
lseektype=''
make_set_make=''
if $test X"$sPRIfldbl" = X; then
echo "Cannot figure out how to print long doubles." >&4
+else
+ sSCNfldbl=$sPRIfldbl # expect consistency
fi
$rm -f try try.*
case "$sPRIfldbl" in
'') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
+ d_SCNfldbl="$undef";
;;
*) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
+ d_SCNfldbl="$define";
;;
esac
d_PRIo64='$d_PRIo64'
d_PRIu64='$d_PRIu64'
d_PRIx64='$d_PRIx64'
+d_SCNfldbl='$d_SCNfldbl'
d_access='$d_access'
d_accessx='$d_accessx'
d_alarm='$d_alarm'
sPRIo64='$sPRIo64'
sPRIu64='$sPRIu64'
sPRIx64='$sPRIx64'
+sSCNfldbl='$sSCNfldbl'
sched_yield='$sched_yield'
scriptdir='$scriptdir'
scriptdirexp='$scriptdirexp'
* This symbol, if defined, contains the string used by stdio to
* format long doubles (format 'e') for output.
*/
+/* PERL_SCNfldbl:
+ * This symbol, if defined, contains the string used by stdio to
+ * format long doubles (format 'f') for input.
+ */
#$d_PRIfldbl PERL_PRIfldbl $sPRIfldbl /**/
#$d_PRIgldbl PERL_PRIgldbl $sPRIgldbl /**/
#$d_PRIeldbl PERL_PRIeldbl $sPRIeldbl /**/
+#$d_SCNfldbl PERL_SCNfldbl $sSCNfldbl /**/
/* Off_t:
* This symbol holds the type used to declare offsets in the kernel.
#if !defined(Perl_atof) && defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
# if !defined(Perl_atof) && defined(HAS_STRTOLD)
-# define Perl_atof(s) strtold(s, (char**)NULL)
+# define Perl_atof(s) (NV)strtold(s, (char**)NULL)
# endif
# if !defined(Perl_atof) && defined(HAS_ATOLF)
-# define Perl_atof atolf
+# define Perl_atof (NV)atolf
+# endif
+# if !defined(Perl_atof) && defined(PERL_SCNfldbl)
+# define Perl_atof PERL_SCNfldbl
+# define Perl_atof2(s,f) sscanf((s), "%"PERL_SCNfldbl, &(f))
# endif
#endif
#if !defined(Perl_atof)
# define Perl_atof atof /* we assume atof being available anywhere */
#endif
+#if !defined(Perl_atof2)
+# define Perl_atof2(s,f) ((f) = (NV)Perl_atof(s))
+#endif
/* Previously these definitions used hardcoded figures.
* It is hoped these formula are more portable, although
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