biohisham has asked for the wisdom of the Perl Monks concerning the following question:
also (int) in the 16th line has been unavoidable for me to make this c +ode work since I wanted to work with numbers
#!/usr/local/bin/perl use strict; use warnings; my @list; print "Enter a list and q when finished\n"; while(<>){ if(/^q/){ ∁ }else{ chomp; int; push (@list,$_); } } sub comp{ print "+v\t\t-v\t\t+v\t\t-v\n"; foreach my $element (@list){ my $negative= ~$element; printf "%d\t\t%d\t\t%#b\t\t%#32b\t\n", $element, $nega +tive, $element,$negative; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: bit selections
by GrandFather (Saint) on Jun 29, 2009 at 22:52 UTC | |
by ikegami (Patriarch) on Jun 29, 2009 at 23:27 UTC | |
|
Re: bit selections
by Anonymous Monk on Jun 29, 2009 at 22:12 UTC | |
by biohisham (Priest) on Jun 29, 2009 at 22:21 UTC | |
by Anonymous Monk on Jun 30, 2009 at 12:15 UTC | |
by biohisham (Priest) on Jul 31, 2009 at 23:58 UTC |