(50G): Exact Integer Division to Integer Base - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (50G): Exact Integer Division to Integer Base (/thread-7675.html) |
(50G): Exact Integer Division to Integer Base - Gerald H - 01-27-2017 07:34 PM 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:
RE: HP 50g: Exact Integer Division to Integer Base - Gerald H - 01-28-2017 06:14 AM 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 } |