Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: finding the correct integer

by haukex (Archbishop)
on Nov 30, 2020 at 16:17 UTC ( [id://11124402]=note: print w/replies, xml ) Need Help??


in reply to finding the correct integer

Obligatory link to What Every Programmer Should Know About Floating-Point Arithmetic and reference to bignum iff you don't mind the performance hit.

$ perl -wMstrict -Mbignum -le 'print int(0.6505 / 0.0001)' 6505 # Or, limit the scope of the pragma: $ perl -wMstrict -le 'print do { use bignum; int(0.6505 / 0.0001) }' 6505

Log In?
Username:
Password:

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

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

    No recent polls found