Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: how to always round up in perl?

by sbohning (Initiate)
on Oct 11, 2021 at 17:01 UTC ( [id://11137426]=note: print w/replies, xml ) Need Help??


in reply to Re^2: how to always round up in perl?
in thread how to always round up in perl?

They also fail with negative non-integers.
perl -MPOSIX=ceil -e "$n=-2.1; print($n, ' POSIX: ', ceil($n))" # -2.1 POSIX: -2 perl -e "$n=-2.1; print($n, ' other: ', int($n) + ($n != int($n)))" # -2.1 other: -1

Log In?
Username:
Password:

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

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

    No recent polls found