in reply to Re^3: converting binary to decimal
in thread converting binary to decimal
$n = (0 . $n =~ tr/1-9/246802468/r | $n =~ tr/1-9/00001/r . $_) =~
s/^0+(?=.)//r
I have no idea what I'm looking at, but I think, if I can ever come up with code like this, I will have become a Perl hacker. Haha for example, I don't understand how transforming digits from 1-9 into 246802468 is going to end up as a decimal in the end. So, I don't understand any of this. But I find it fascinating/amazing.
I'm Harangzsolt33, but somehow I got logged out.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: converting binary to decimal
by tybalt89 (Monsignor) on Jun 06, 2025 at 15:28 UTC | |
|
Re^5: converting binary to decimal
by afoken (Chancellor) on Jun 06, 2025 at 15:52 UTC | |
by harangzsolt33 (Deacon) on Jun 06, 2025 at 18:10 UTC | |
by jo37 (Curate) on Jun 06, 2025 at 18:36 UTC |