in reply to Round Down Routine

$retval = $number > 16 ? 16 : int($number)
would work for numbers >= 0.

Update: but see int for the implications of this construct. Basically, you should probably use POSIX::floor instead of int().

updated see reply below

Replies are listed 'Best First'.
Re^2: Round Down Routine
by bradenshep (Beadle) on Oct 20, 2007 at 04:02 UTC
    I think you mean
    $retval = $number > 16 ? 16 : int($number)
    since yours would return 16 every time?

    int() might return 0, given a value less than 1, though, so POSIX::floor() might still be a better plan.