Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-08-02 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (55 votes), past polls