[PLUG] Perl round-up

Ed Sawicki ed at alcpress.com
Tue Aug 13 17:36:44 UTC 2002


Yes, ceil(). That wasn't obvious in the Perl books
I have.

Thanks
Ed


On Tue, 2002-08-13 at 10:16, Matt King wrote:
> I'm not 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
> 
> 
> 
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 






More information about the PLUG mailing list