Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w 
    use strict; 
    ...
    print (($decimal & 0x04)? (1) : (0) );    # to test the 3th bit
    print (($decimal & 0x02)? (1) : (0) );    # to test the 2nd bit
    print (($decimal & 0x01)? (1) : (0) );    # to test the 1st bit