Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: finding the correct integer

by perlfan (Vicar)
on Nov 30, 2020 at 18:06 UTC ( [id://11124407]=note: print w/replies, xml ) Need Help??


in reply to finding the correct integer

What precision are you expecting? Math::BigFloat may assist, but it doesn't seem like you're needing that hammer. Documentation on int states, You should not use this function for rounding: one because it truncates towards 0, and two because machine representations of floating-point numbers can sometimes produce counterintuitive results. Furthermore, Usually, the sprintf, printf, or the POSIX::floor and POSIX::ceil functions will serve you better than will int. You're already using POSIX so take a look at ceil or floor, depending on what you're expecting.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found