Very, very roughly I could fix the problem by doing like blow:
#################################################################
my $HALF = 0.50000000000008; # same as original $Math::Round::half
sub another_nearest ($$) {
my($exp, $num) = @_;
if ($num >= 0) {
return int($num * 10 ** (-$exp) + $HALF) / 10 ** (-$exp);
} else {
return POSIX::ceil($num * 10 ** (-$exp) - $HALF) / 10 ** (-$exp);
}
}
say another_nearest(-2, 64.005);
#################################################################
But this code will cause another problem. It will cause overflow errors
far more easily than original Math::Round::nearest. Generally, I don't
recommend above solution.
--
Masanori HATA