5% assure discount from here only

Tuesday, January 25, 2011

(5) Does Perl have a round() function?

Solution :

The POSIX module (part of the standard Perl distribution)
implements ceil(), floor().

use POSIX;

$ceil = ceil(3.5); # 4
$floor = floor(3.5); # 3

No comments:

Post a Comment