(49G) Negadecimal to Decimal Programme & OEIS A256639
04-25-2015, 06:58 AM (This post was last modified: 06-15-2017 01:45 PM by Gene.)
Post: #1
 Gerald H Senior Member Posts: 1,420 Joined: May 2014
(49G) Negadecimal to Decimal Programme & OEIS A256639
Below a programme to convert negadecimal base numbers to decimal.

The advantage of negadecimal base is that there is no need for a negative sign. Indeed, the old problem of the existence of negative numbers disappears as they become interleaved with the positives. & what happens to the question of sign? The notational resolution of these two bugbears of traditional numeration is surely of some utility.

Reading the digits of a negadecimal number from right to left, they represent

units, negative tens, hundreds, negative thousands, ten thousands,......

eg Negadecimal 36123 is 3+2*(-10)+1*(100)+6*(-1000)+3*(10000), or base 10 24083.

Similarly, 1066 negadecimal becomes -1054 decimal.

For conversion decimal to negadecimal programme see:

http://oeis.org/A256639

::
CK1&Dispatch
# FF
::
ZINT -10
1LAMBIND
FPTR2 ^DupZIsNeg?
SWAP
FPTR2 ^ZABS
Z1_
Z0_
ROT
BEGIN
FPTR2 ^DupQIsZero?
NOT_WHILE
::
ZINT 10
FPTR2 ^ZDIVext
4ROLL
DUP
1GETLAM
FPTR2 ^RMULText
5UNROLL
FPTR2 ^RMULText
ROT
SWAP
;
REPEAT
ABND
DROPSWAPDROP
SWAP
case
FPTR2 ^RNEGext
;
;
 « Next Oldest | Next Newest »

 Messages In This Thread (49G) Negadecimal to Decimal Programme & OEIS A256639 - Gerald H - 04-25-2015 06:58 AM

User(s) browsing this thread: 1 Guest(s)