Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Variables are automatically rounded off in perl

by AnomalousMonk (Archbishop)
on Jul 21, 2016 at 07:03 UTC ( [id://1168206]=note: print w/replies, xml ) Need Help??


in reply to Variables are automatically rounded off in perl

c:\@Work\Perl\monks>perl -wMstrict -le "my $hash; $hash->{TGT} = 3335.9999999999995; printf '%0.20f', $hash->{TGT}; " 3335.99999999999950000000
Please see print, printf, sprintf, What Every Computer Scientist Should Know About Floating-Point Arithmetic.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found