Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 drinking their drinks and smoking their pipes about the Monastery: (14)
As of 2014-10-31 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (223 votes), past polls