[PLUG] Perl round-up

Matt King mking at magnetinternet.com
Tue Aug 13 17:15:32 UTC 2002


I'm no Perl expert but what about ceiling() ?

-- 
Matt King
magnet | internet
http://www.magnetinternet.com

 Ed Sawicki busted out the keyboard and typed:
> I need to round a floating point number up to the next
> integer, regardless of what the fractional part is.
> Here's my first attempt:
>
> if (int($score) != $score) {
>     $score = int($score) + 1;
> }
>
> Is there a more clever way?
>
> Ed - A Perl novice
>
>
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug







More information about the PLUG mailing list