Post Reply 
(49G) Convert Integer from Integer Base A to Integer Base B
07-15-2022, 06:45 PM
Post: #3
RE: HP 49G: Convert Integer from Integer Base A to Integer Base B
(07-15-2022 10:27 AM)Gerald H Wrote:  eg The stack

{ 17 56 9797 4 }

18975263

18975262

will convert the level three base 18975263 number to the base 18975262 number

{ 17 107 9960 9874 }.

We can go from base b1 to base b2, by synthetic division.

b2 = b1 - 1

1 > 17 56 9797 4
1 > 17 73 9870 9874
1 > 17 90 9960
1 > 17 107

Results might require doing carries (in base b2), to limit digits = 0 .. b2-1

This avoided the steps of getting N, and the reverse of N to base b2.

N = horner([17, 56, 9797, 4], b1) = 116148179948924836904678
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 49G: Convert Integer from Integer Base A to Integer Base B - Albert Chan - 07-15-2022 06:45 PM



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