Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^8: Avoiding perl's Atof when assigning floating point values

by syphilis (Archbishop)
on Jul 31, 2018 at 14:36 UTC ( [id://1219577]=note: print w/replies, xml ) Need Help??


in reply to Re^7: Avoiding perl's Atof when assigning floating point values
in thread Avoiding perl's Atof when assigning floating point values

I probably ought at least find out exactly what that change of behaviour is

Here's the script that demonstrates that change of behaviour:
use warnings; use locale; $m = "3.14e+9" + 0; $n = "3,14e+9" + 0; print "\$m is $m\n"; print "\$n is $n\n";
On current bleadperl (and recent "double" and "long double" perls) it outputs:
$m is 3140000000 $n is 3140000000
But when I patch bleadperl to assign with Perl_strtod (or run that script on a quadmath build of perl) it outputs:
$m is 3140000000 $n is 3
AFAICT, it pertains solely to the numification of strings. When values are assigned as barewords, there's no difference between the behaviour of the various builds.
And I think it comes into play only if the locale radix character is a comma.
My next step is to find out whether this needs to be fixed before my proposed patches can be applied.

Cheers,
Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1219577]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found