in reply to Re: Math::Base - arithmetics with baseX integers
in thread Math::Base - arithmetics with baseX integers (updated)
What I did is to mimic the behavior of sprintf and hex in encode(), i.e. roll over:
$num = (~abs($num))+1 if $num < 0;
And the return line now reads:
return join( '', reverse @ret) || 0;
I've updated the op with the new version. Thanks for your hints!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Math::Base - arithmetics with baseX integers (OP updated)
by no_slogan (Deacon) on Aug 23, 2017 at 18:08 UTC | |
by shmem (Chancellor) on Aug 23, 2017 at 19:45 UTC | |
by no_slogan (Deacon) on Aug 24, 2017 at 16:09 UTC | |
by BrowserUk (Patriarch) on Aug 24, 2017 at 00:54 UTC | |
by no_slogan (Deacon) on Aug 24, 2017 at 03:01 UTC | |
by BrowserUk (Patriarch) on Aug 24, 2017 at 12:35 UTC | |
by no_slogan (Deacon) on Aug 24, 2017 at 14:21 UTC |