d say that no matter what $QCTAvgSecs
is, the sprintf is going to be slower.
An even better way would be POSIX::floor, as perldoc -f int will
tell us, although that might also be slower than int.
use POSIX qw(floor);
my $pi = 3.1415927;
print floor $pi;
(darren)
> At 01:46 PM 7/9/2001, darren
How would that be diff from $mins = sprintf("%02d",$QCTAvgSecs/60);
or would it?
At 01:46 PM 7/9/2001, darren chamberlain wrote:
>Thomas Jakub <[EMAIL PROTECTED]> said something to this effect on 07/09/2001:
>> in c++ you can floor a variable to drop the decimal
>&g
Thomas Jakub <[EMAIL PROTECTED]> said something to this effect on 07/09/2001:
> in c++ you can floor a variable to drop the decimal
> points. How can you do this with perl?
Use the int function (perldoc -f int).
my $pi = 3.1415927;
print int $pi;
# prints 3
(darren)
--
Use integer, e.g.
print "her age is integer($age)";
The function will round up to the next highest number.
-Original Message-
From: Thomas Jakub [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 3:36 PM
To: [EMAIL PROTECTED]
Subject: floor
in c++ you can floor a variab
in c++ you can floor a variable to drop the decimal
points. How can you do this with perl?
__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/