Tore Aursand wrote:
> On Sun, 16 Nov 2003 23:24:29 -0800, R. Joseph Newton wrote:
> > If you want to round, use:
> > my $rounded = int ($float_value + 0.5);
>
> ...which only works if you have a positive number. You must make it a bit
> more foolproof;
>
> my $rounded = ($nr > 0) ? int($nr + 0.
On Nov 17, 2003, at 1:24 AM, R. Joseph Newton wrote:
Mike Blezien wrote:
So if I use the int() this will provide the same results as this
ceil() function
does... ??
Nope. Same as floor(). If you want to round, use:
my $rounded = int ($float_value + 0.5);
Please read the rest of the thread be
On Sun, 16 Nov 2003 23:24:29 -0800, R. Joseph Newton wrote:
> If you want to round, use:
> my $rounded = int ($float_value + 0.5);
...which only works if you have a positive number. You must make it a bit
more foolproof;
my $rounded = ($nr > 0) ? int($nr + 0.5) : int($nr - 0.5);
--
Tore Aur
Mike Blezien wrote:
> Hi,
>
> So if I use the int() this will provide the same results as this ceil() function
> does... ??
Nope. Same as floor(). If you want to round, use:
my $rounded = int ($float_value + 0.5);
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
Mike Blezien wrote:
>
> 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 or is there function in
> perl cal
On Nov 13, 2003, at 11:38 AM, Mike Blezien wrote:
Hi,
so I guess my question is, if I want to accomplish the same results as
this "ceil" how would that be accomplished in Perl ??
use POSIX qw/ceil/;
$float = '1.9';
print ceil($float);
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additiona
Yes, this did the trick exactly :)
thanks for your help
--
MikeBlezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Quality Web Hosting
http://www.justlightening.net
MSN: [EMAIL PROTECTED]
=-=-=-=-=-=-
On Nov 13, 2003, at 10:38 AM, Mike Blezien wrote:
Hi,
so I guess my question is, if I want to accomplish the same results as
this "ceil" how would that be accomplished in Perl ??
Does this one-liner get you started?
perl -e 'use POSIX qw(ceil); print ceil(2.3), "\n";'
James
--
To unsubscribe,
Hi,
so I guess my question is, if I want to accomplish the same results as this
"ceil" how would that be accomplished in Perl ??
thx's
--
MikeBlezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Quali
On Nov 13, 2003, at 10:17 AM, Mike Blezien wrote:
So if I use the int() this will provide the same results as this
ceil() function does... ??
No, it's not the same. See the chart earlier in this thread. Sorry
for confusing the issue.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For ad
Hi,
So if I use the int() this will provide the same results as this ceil() function
does... ??
thx's
--
MikeBlezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Quality Web Hosting
http://www.justl
On Nov 13, 2003, at 10:01 AM, Jeff 'japhy' Pinyan wrote:
No, int() is neither exactly like ceil() or floor(). All int() does is
truncate the number to an integer. If you have 2.3, you get 2. If you
have 2.9, you get 2. If you have -2.3, you get -2. If you have -2.9,
you
get -2. If you were
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
On Nov 13, James Edward Gray II said:
>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
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
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 drop
16 matches
Mail list logo