====== - 利用POSIX模块处理 向下/向上取整 ====== use POSIX; POSIX::ceil(3.14) => 4 #向上取整 POSIX::floor(3.14) => 3 # 向下取整, 等同于 int(3.14) ====== - 利用Math::Round 做四舍五入 ====== use Math::Round; my $num = 45.4; my $round = Math::Round($num);