#!/usr/bin/perl -w use strict; use Math::BigInt; #BigInt KiloByte Unit my $KB = Math::BigInt->new( "1024" ); #BigInt MegaByte Unit my $MB = $KB->copy()->bmul( $KB ); #BigInt GigaByte Unit my $GB = $MB->copy()->bmul( $KB ); print "$KB, $MB, $GB\n"; my $arg1 = Math::BigInt->new( shift ); my $arg2 = Math::BigInt->new( shift ); # arg1 is in GBs my $GBarg1 = $arg1->copy()->bmul( $GB ); # arg2 is in MBs my $MBarg2 = $arg2->copy()->bmul( $MB ); print $GBarg1, " ", $MBarg2, "\n"; # why rc is 0? my ($rc, $rem) = $GBarg1->copy()->bdiv( $MBarg2 ); print "rc is [$rc]\n";