in reply to Re^7: converting binary to decimal
in thread converting binary to decimal
my $copy1b = '0' . $copy1; my $copy2b = $copy2 . $_; $n = ($copy1b | $copy2b);
copying it literally into the debugger too
DB<38> say (0 . "$_" | 1 . "1") for qw/0 2 4 6 8/ 11 11 15 15 11
The only fix is using |. and use feature 'bitwise';
DB<39> use feature 'bitwise'; say (0 . "$_" |. 1 . "1") for qw/0 2 4 + 6 8/ 11 13 15 17 19
> voodoo89
Yeah, now go back and sacrifice 89 more chickens to the god of golf ;-P
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^9: converting binary to decimal
by tybalt89 (Monsignor) on Jun 08, 2025 at 00:19 UTC | |
by LanX (Saint) on Jun 08, 2025 at 11:06 UTC | |
by tybalt89 (Monsignor) on Jun 08, 2025 at 14:21 UTC | |
by LanX (Saint) on Jun 08, 2025 at 16:05 UTC | |
by harangzsolt33 (Deacon) on Jun 08, 2025 at 15:32 UTC | |
by LanX (Saint) on Jun 08, 2025 at 16:02 UTC |