Christopher Zukowski <[EMAIL PROTECTED]> said something to this effect on 
07/09/2001:
> How would that be diff from $mins  = sprintf("%02d",$QCTAvgSecs/60);
> 
> or would it?

I have no idea what $QCTAvgSecs is; it might, or it might not.
Intuitively, though, I would 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 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
> >> points.  How can you do this with perl?
> >
> >Use the int function (perldoc -f int).
> >
> >my $pi = 3.1415927;
> >
> >print int $pi;
> >
> ># prints 3

-- 
If only God would give me some clear sign! Like making a large
deposit in my name in a Swiss bank.
    -- Woody Allen

Reply via email to