in reply to Math::BigInt Newbee question.
Math::BigInt code reads much more simply if you treat them as numbers; you can also take advantage of the fact that when one of the operands of a numeric operator is a Math::BigInt the other is automatically upgraded:
use Math::Bigint; my $KB = Math::BigInt->new(1024); my $MB = $KB * $KB; my $GB = $MB * $KB; my $required = shift(@ARGV) * $GB; my $CDsize = shift(@ARGV) * $MB; print +($required + $CDsize - 1) / $CDsize;
Hugo
|
|---|