develooper Front page | perl.perl5.porters | Postings from April 2018

Why is Perl_strtod defined, but then ignored ?

April 17, 2018 12:59
Why is Perl_strtod defined, but then ignored ?
Message ID:

On Linux (Ubuntu), when I build current devel (5.27.10), Perl_strtod is 
But then, instead of using Perl_strtod to assign floating point values, perl 
still uses it's own atof routine.
This is somewhat disappointing because Perl_strtod assigns accurately 
(rounding to nearest, ties to even) whereas perl's atof mostly does not.

The exception here is the -Dusequadmath build which *does* assign the value 
that Perl_strtod ascribes - and therefore assigns values accurately.
Bizarrely it then claims (in its 'perl -V') that USE_PERL_ATOF was a 
compile-time option.

When I hack numeric.c so that the 'double' and 'long double' builds follow 
the same pathway as the quadmath build then, lo and behold, they also assign 

What is the rationale here that has Perl_strtod ignored on 'double' and 
'long double' builds when it is defined ?
(I had envisaged that the defining of Perl_strtod would signal that *it* 
should be used by perl to assign values. Was that ever the case ?)

Rob Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About