(50G): Exact Integer Division to Integer Base
|
01-27-2017, 07:34 PM
(This post was last modified: 06-15-2017 01:41 PM by Gene.)
Post: #1
|
|||
|
|||
(50G): Exact Integer Division to Integer Base
For input
A B C A,B,C integers the programme returns A / B to base C. eg For input 5 111 7 the programme returns :7: { "." "°" 0 2 1 3 1 0 3 3 5 } Similarly 123 77 2 :2: { 1 "." "°" 1 0 0 1 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 } and 17 11 107 :107: { 1 "." "°" 58 38 97 29 19 48 68 9 77 87 } and 27 6 37 37: { 4 "." "°" 18 } "°" indicates the beginning of the recursive part of the decimal. Code:
|
|||
01-28-2017, 06:14 AM
Post: #2
|
|||
|
|||
RE: HP 50g: Exact Integer Division to Integer Base
The programme also delivers correct results for negative bases, eg
1 600 -10 :-10: { "." 0 0 -1 "°" 6 -6 } and 6000000 70 -10 :-10: { 8 -5 7 -1 4 "." "°" -2 8 -5 7 -1 4 } |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)