Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Can't get GCD to work in Bit::Vector module

by antirice (Priest)
on Jun 18, 2004 at 14:57 UTC ( [id://367962]=note: print w/replies, xml ) Need Help??


in reply to Can't get GCD to work in Bit::Vector module

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

Replies are listed 'Best First'.
Re^2: Can't get GCD to work in Bit::Vector module
by tperdue (Sexton) on Jun 18, 2004 at 15:11 UTC
    Worked perfectly. Thanks for the help.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://367962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found