You should probably define $vecgcd. The following works:
use Bit::Vector; my $veca = Bit::Vector->new_Bin(5,"00101"); # 5 my $vecb = Bit::Vector->new_Bin(5,"01010"); # 10 my $vecgcd = Bit::Vector->new(5); $vecgcd->GCD($veca,$vecb); # should be 5 print $vecgcd->to_Bin(); __END__ 00101
Hope this helps.
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
In reply to Re: Can't get GCD to work in Bit::Vector module
by antirice
in thread Can't get GCD to work in Bit::Vector module
by tperdue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |