sub trunc { my $r = shift; return 0 if ! $r; my $s = $r + $r/abs($r); return $r % $s; } sub grr { my ($q, $d) = @_; return int( $q/$d); }