#!/usr/bin/perluse strict my $a = 5;my $b = 2; my tmp1 = $a / $b ;print "tmp1\n"; my tmp2 = int(tmp1);print "tmp2\n"; my tmp3 = $a % $b ;print "tmp3\n";
分别打印如下结果:
2.5
2
1
京公网安备 11010502049817号