Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by chrestomanci (Priest)
on Feb 25, 2011 at 09:19 UTC ( #890150=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $n = 3.0;
    my $ceiling = int($n);
    $ceiling += 1 if $ceiling != $n;
    
  2. or download this
    my $ceiling = int($n) + ($n != int($n));
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://890150]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2017-02-22 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (327 votes). Check out past polls.