#!/usr/bin/perl -w use strict; use warnings; sub RoundDownSpecial_bizarro { my $num = shift; my $den = shift; return 7 unless $den+0.0; return 8 unless $num+0.0; my $tmp = int(($num+0.0) / $den); return 16 if $tmp > 16; return 16 if $tmp < 1; return int($tmp); } while () { chomp; my ($n, $d) = split /,/; print join(" ",$n, $d, RoundDownSpecial_bizarro($n, $d)), "\n"; } __DATA__ 0, 1 10, 0 100, 1 1, 100 2, 1 8, 1 15, 1 16, 1 17, 1