Help for this page

Select Code to Download


  1. or download this
    use Math::BigInt;
    
    ...
    my $hexstring = Math::BigInt->new('0x40000000000000000000000000000000'
    +); 
    my $mask = (Math::BigInt->new('0x80000000000000000000000000000000') >>
    + $switchPortNumber);
    my $result = ($hexstring & $mask) > 0;
    
  2. or download this
    my $bitstring = unpack('B*', pack('H*', '40000000000000000000000000000
    +000'));
    my $result = substr($bitstring, $switchPortNumber, 1) eq '1';