James Edward Gray II wrote:
>
> On Nov 13, 2003, at 9:50 AM, Bob Showalter wrote:
>
> > Mike Blezien wrote:
> >> Hi,
> >>
> >> Ran accross a function called "ceil" and from the information I got
> >> on this:
> >>
> >> "ceil() [Stands for ceiling], it just rounds a float value up.. so
> >> ceil(4.7) == ceil(4.1342) == 5"
> >>
> >> would this be the same as using "int" function in perl
> >
> > No. int() simply drops the fractional part.
>
> ceil() is often presented with a sister function called floor().  That
> would be the same as Perl's int().

Thanks James.

I'm being deliberately lazy here. 'floor' 'ceil' and 'int' have
very particular specification in C in terms of whether they return
an integer or a float. (Even in Perl, 3.0 is different from 3).
Also they may round towards zero or negative infinity.

For example, func(-3.5) may be -3, -4, -3.0 or -4.0.

Anyone care to elaborate?

Rob

BTW, I can't stomach 'foo' or 'bar'. It makes me nauseous just
to type them.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to