Documentatioî foò RPNMX.COM Thió documenô applieó tï versioî 1.3i of RPNMX Copyrighô (c© 198´ bù authorº Harrù Ê Smith¬ Saratoga¬ CA INTRODUCTION Tï  uså  thå  prograí typå thå namå oæ thå COÍ filå aô  thå  CP/Í prompô  linå witè á returî anä nï parameters®  Thå  prograí  wilì loaä anä responä with: *** RPNMX *** Version 1.3i, April 21, 1984 Copyright 1984 by author Harry J Smith, Saratoga, CA Reverse Polish Notation Multi-precision fixed point calculator Has a stack of four 1001 decimal digit numbers Press ESC to interrupt a long calculation or display Base = 10 base ten, Max digit = 9 **** PRESS ANY KEY TO CONTINUE OR ^C **** Presó returî oò thå spacå baò gives: n Enter a number, may have a + or - sign ! X factorial " Start/stop comment field " CC...C" % X = Y MOD X, Y = Y / X (N) Don't display number of digits (Y) Display number of digits * Multiply ** X = Y ** X Power + Add - Subtract / Divide ? Display this help menu A Auto display on/off B Set base to X BEL Bell prompt on/off C Change sign of X CL Clear X D Display X DL Display learned line E Enter X again EX Execute learned line **** PRESS ANY KEY TO CONTINUE OR ^C **** Presó returî oò thå spacå baò gives: EXX Execute X times I Interchange X and Y L Last X LRN Learn N= Don't display = sign O On, Reinitialize Š R Square Root R1 Recall memory register 1 R2 Recall memory register 2 RMB Recall Modulo base RN Generate a random number < modulo base or 80 bits RR Y = X ** 0.5, X = Remainder RRN Recall random number or seed S Square S1 Store X in memory register 1 S2 Store X in memory register 2 S<> Stop if X <> 0 S= Stop if X = 0 SG Set digits per group for output display of X SMB Set Modulo base to X, X = 0 => no Modulo base SP Set spacing value, -1...3 **** PRESS ANY KEY TO CONTINUE OR ^C **** Presó returî oò thå spacå baò gives: SRN Store seed for random number V Rotate stack down X Exit Y= Display = sign ½ 0 COMMANDº Commandó  maù  bå entereä onå aô á timå followeä bù á  returî  oò severaì oî á linå separateä bù onå oò morå spaces. Sincå thió ió aî RPÎ calculator¬ ³ ª (´ « 5© ió entereä as: ³ ´ µ « ª oò ´ µ « ³ * Bå carefuì noô tï enteò morå thaî ´ itemó oî thå stacë aô anù onå time® Thå itemó oî thå stacë arå referreä tï aó X¬ Y¬ Z¬ anä B® Ø ió  thå iteí oî thå toð oæ thå stack¬  Ù ió jusô undeò X¬  theî Ú undeò Y¬ anä finallù  ió oî thå bottom® Operationó thaô takå twï argumentó  wilì  poð  Ø  anä Ù ofæ  oæ  thå  stack¬  perforí  thå operation¬  anä  pusè  thå resulô bacë ontï thå  stack®  Sucè  aî operatioî wilì alwayó resulô witè Ú anä  beinç equaì sincå  wheî Ø ió popped¬   ió duplicateä intï Z® Thå stacë ió alwayó full® Á pusè  operatioî loseó B®  Operationó thaô takå onlù onå  argumenô wilì poð X¬ perforí thå operation¬ anä pusè thå result. Thió  endó  thå  introduction®  É wilì no÷ explaiî  eacè  commanä takinç theí iî ASCIÉ sorô order. n Enter a number, may have a + or - sign: Herå  î referó tï keyinç iî aî integeò likå ° oò  123456789®  Thå integeò  ió  merelù pusheä ontï thå stack®  Thå waù  tï  enteò  á negativå  numbeò  ió tï enteò itó absolutå valuå anä theî  changå Šitó  sigî witè thå à commanä oò puô á - sigî iî fronô oæ iô  witè nï  space®  Commaó maù bå inserteä iî thå numbeò betweeî anù  twï digitó  tï  aiä iî reading®  Foò examplå -12,345,67¸ ió  á  legaì inpuô number. ¡ Ø factorial: Replaceó Ø witè thå factoriaì oæ Ø ½ ± ª ² ª ³ ª ..® ª X. ¢ Start/stoð commenô fielä ¢ CC...C": Commentó  caî bå entereä aô anù timå anä arå quitå usefuì oî  thå learneä line¬  seå LRN® Thå commenô ió starteä witè á ¢ marë witè á spacå oî botè sideó oæ it®  Thå commenô ió endeä witè á ¢  marë witè á spacå afteò it. ¥ Ø ½ Ù MOÄ X¬ Ù ½ Ù ¯ X: Ø anä Ù arå poppeä ofæ thå stack¬ botè thå quotienô anä remaindeò oæ  Ù divideä bù Ø ió computed¬  thå quotienô ió pusheä ontï  thå stacë anä theî thå remaindeò ió pushed. (N© Don'ô displaù numbeò oæ digits: Sincå  RPNMØ  caî displaù 100± decimaì digiô numberó iô  ió  somå timeó  desirablå tï includå iî thå displaù á counô oæ thå  numbeò oæ  digits®  Thió  optioî  ió  selecteä bù thå  commanä  (Y©  anä deselecteä bù thå commanä (N)® Foò examplå 1° ¡ wilì displaù as: ½ 362880° (7) iæ  thå  optioî ió selected®  Iæ thå counô ió lesó thaî ´  iô  ió noô displayed®  Iæ thå baså ió seô tï á baså otheò thaî ten¬  thå counô  oæ  thå numbeò oæ digitó wilì stilì bå iî baså  ten®  Thuó fifteeî iî baså ² wilì displaù as: ½ 111± (4) iæ thå optioî ió selected. (Y© Displaù numbeò oæ digits: Selecô  thå  optioî tï displaù thå counô oæ thå numbeò oæ  digitó followinç thå displaù oæ thå value® Seå (N© above. ª Multiply: Poð Ø anä Y¬ Pusè Ø timeó Y. *ª Ø ½ Ù *ª Ø Power: Poð Ø anä Y¬ Pusè Ù tï thå poweò oæ X. « Add: ŠPoð Ø anä Y¬ Pusè suí oæ Ø anä Y. - Subtract: Poð Ø anä Y¬ Pusè Ù minuó X. ¯ Divide: Poð Ø anä Y¬ Pusè Ù divideä bù X. ¿ Displaù thió helð menu: Causeó thå helð menõ tï bå displayed®  Iô ió thå samå aó thå menõ displayeä  wheî  yoõ  firsô  enteò  thå  program¬  buô  thå  baså displayeä wilì bå thå currentlù selecteä base. Á Autï displaù on/off: Normally¬  afteò eacè commanä linå ió executed¬  thå contentó  oæ thå  toð oæ thå stack¬  X¬  ió converteä tï thå selecteä baså anä displayed®  Wheî computinç witè largå numbers¬  thå timå spenô iî thió  conversioî  caî  bå  morå  thaî  thå  timå  spenô  iî   thå calculation®  Iô  ió  desirablå theî tï bå ablå tï  prevenô  thió automatiã display® Eacè timå thå Á commanä ió giveî thå selectioî statuó oæ thió optioî ió reversed.  Seô baså tï X: Initiallù  thå  baså oæ botè inpuô anä outpuô displaù ió  seô  tï ten®  Iô  caî bå changeä aô anù timå tï á numbeò betweeî ² anä 3¶ decimal®  Iæ  thå baså ió ten¬  thå commanä 3¶  woulä Poð Ø  anä changå thå baså tï 3¶ baså 1° anä display: Baså ½ 3¶ baså ten¬ Maø digiô ½ Z Jusô  aó thå digiô Æ ió wortè 1µ baså teî wheî iî  baså  16¬  thå digiô  Ú  ió wortè 3µ baså teî wheî iî baså 36®  Wheî iî  á  baså greateò thaî ten¬ numberó ³ digitó oò lesó maù havå tï bå entereä witè á leadinç ° tï prevenô beinç mistakeî foò á command® Wheî iî baså 1¶ baså ten¬ á teî musô bå entereä aó 0Á insteaä oæ Á oò thå autï displaù statuó wilì bå changed. BEÌ Belì prompô on/off: This is good for timing long calculations. à Changå sigî oæ X: Samå  aó multiplyinç Ø bù minuó one®  One waù tï enteò á negativå numbeò ió tï enteò itó absolutå valuå anä theî changå itó sign. CÌ Cleaò X: Ø ió seô tï zero®  Y¬ Ú anä  arå noô affected® CÌ « ió usefuì tï perforí á Poð command. Š Ä Displaù X: Thió commanä ió usefuì wheî thå autï displaù ió turneä off®  Alsï usefuì iî thå learneä linå tï displaù intermediatå results. DÌ Displaù learneä line: Displayeó  thå  currenô  contentó  oæ  thå  learneä  line®  Whilå commandó  maù  bå giveî iî eitheò uppeò oò loweò caså oò  eveî  á mixture¬ thå learneä linå ió alwayó displayeä iî uppeò case. Å Enteò Ø again: Thió duplicateó Ø anä Pusheó iô ontï thå stack®  Å Å Å wilì  filì thå stacë witè X. EØ Executå learneä line: Thió  wilì causå thå learneä linå tï bå executeä oncå iæ therå ió nï  EØ commanä iî thå learneä line®  Havinç LRÎ and/oò EØ iî  thå learneä linå caî producå interestinç results®  Á simplå caså ió á normaì learneä linå witè EØ aó itó lasô command¬  thió wilì causå thå  lerneä linå tï bå repeatedlù executeä untiì thå ESà keù  ió pressed. EXØ Executå Ø times: Thió  wilì  Poð  Ø anä causå thå learneä linå tï  bå  executeä  Ø times. É Interchangå Ø anä Y: Poð X¬ Poð Y¬ Pusè X¬ Pusè Y. Ì Lasô X: Oî alì arithmetiã operationó (!¬ %¬ *¬ **¬ +¬ -¬ /¬ B¬ R¬ RR¬ anä S©  thå  valuå oæ Ø ió saveä iî Lastx¬  Thå Ì  commanä  retrieveó Lastø  anä  Pusheó iô ontï thå stack®  Thió ió  quitå  usefuì  iî undoinç  aî  operatioî  performeä bù mistake®  Iô ió onå  oæ  thå featureó thaô makeó aî RPÎ calculatoò desirable. LRÎ Learn: Thió  commanä  storeó alì oæ thå commandó followinç oî  thå  samå linå aó thió onå intï thå learneä line®  Executioî oæ thå currenô linå  ió  stopped®  Thió linå aó welì aó alì commanä  lineó  arå limiteä tï 25¶ characters® Typå thå learneä line: LRÎ (Y© N½ ± ² LRÎ ± à SÐ Ä ¢ ¡ ½ ¢ ± SÐ ª Ä Ì ± « EX anä theî dï twï seperatå EØ commands®  Yoõ mighô wanô tï keù iî á control-P afteò thå seconä EØ commanä jusô beforå yoõ hiô  returî tï  turî youò printeò on®  Thió wilì prinô á tablå oæ  factorialó Šfroí 2¡  tï 450¡ iæ yoõ waiô lonç enough® Takeó abouô 1± houró oî á ´ Mhú machine® Hiô thå ESà keù twicå tï interrupô anä aborô thå operation if you get tired of waiting. N½ Don'ô displaù ½ sign: Normallù  displayeä resultó arå precedeä witè aî ½ sign®  Thió ió handù  sï  yoõ caî telì wheî á calculatioî ió  completå  anä  thå displaù  conversioî ió beinç done®  Abortinç á displaù conversioî witè  thå ESà keù wilì noô affecô thå valuå computed®  Iæ  thå  ½ sigî ió noô desired¬ thå N½ commanä caî bå given. O On, Reinitialize: Thió  totallù  reinitializeó thå program¬  thå samå aó  reloadinç froí disk®  Similaò tï thå ¿  commanä excepô thå baså ió reseô tï ten. R Square Root: Ø  ió replaceä witè thå integeò portioî oæ thå squarå rooô oæ  X® The fractional portion, if any, is truncated. R1 Recall memory register 1: Besideó  thå stacë anä lasô Ø therå arå twï memorù registeró thaô caî holä anù integeò thaô caî bå generateä bù thió  program®  Thå R± commanä wilì pusè thå contentó oæ thå firsô oæ theså regisreró ontï thå stack. R2 Recall memory register 2: Thå  R²  commanä  wilì  pusè thå contentó oæ  thå  seconä  memorù regisreró ontï thå stack. RM Recalì Modulï base: Thió calculatoò caî bå seô tï perforí alì oæ itó calculationó  iî modulï arithmetic®  Thió ió donå bù settinç thå modulï baså tï aî integeò greateò thaî zerï (seå thå SM command)®  Thå RM commanä wilì  pusè  thå currenô valuå oæ thå modulï baså ontï thå  stack® Normallù  á numbeò equaì tï thå modulï baså wilì bå displayeä  aó zero¬ aî exceptioî tï thió ió madå wheî thå RM commanä ió given. RN Generate a random number < modulo base or 80 bits: Iæ á modulï baså greateò thaî zerï ió seô á randoí numbeò betweeî zerï  anä  thå modulï baså wilì bå generateä anä pusheä ontï  thå stack®  Iæ nï modulï baså ió seô á randoí numbeò betweeî zerï anä ² *ª 8° wilì bå pusheä untï thå stack®  Theoreticallù thå  randoî numbeò  generatoò  wilì  cyclå afteò ² *ª  8°  numbers¬  buô  thå earth will not last that long. RR Y = X ** 0.5, X = Remainder: ŠPoð  X¬  finä botè thå squarå rooô anä remaindeò oæ X¬  Pusè  thå root¬  pusè thå remainder® Thå remaindeò ió defineä iî sucè á waù thaô  thå rooô squareä pluó thå remaindeò ió alwayó thå  originaì number® Thió caî bå useä tï tesô anä tï finä perfecô squares® Thå squarå  rooô  remaindeò oæ á perfecô squarå ió zero®  Iô ió  truå thaô  thå  remaindeò wilì neveò bå largeò thaî twicå  thå  squarå root¬  anä  thió  extremå caså existó wheî Ø ió onå lesó  thaî  á perfecô square. RRN Recall random number or seed: Aó  randoí numberó arå generateä aî 8° biô randoí numbeò ió  kepô anä useä aó thå basió foò thå nexô randoí number® Thå RRÎ commanä pusheó  thió valuå ontï thå stack®  Thå valuå caî bå recordeä  aô thå  enä oæ á sessioî anä reentereä witè thå SRÎ commanä  aô  thå beginninç  oæ  á ne÷ session®  Thió wilì prevenô thå samå  randoí numbeò  froí eveò beinç reused®  Thå valuå wilì bå displayeä witè itó  fulì valuå eveî iæ iô ió largeò thaî oò equaì tï thå  modulï base. S Square: Ø ió replaceä witè thå squarå oæ X® S1 Store X in memory register 1: Besideó thå stacë anä lasô Ø therå arå twï memorù registeró  thaô caî  holä anù integeò thaô caî bå generateä bù thió program®  Thå S± commanä wilì seô thå contentó oæ thå firsô oæ theså  regisreró tï X. X remains unchanged. S2 Store X in memory register 2: Thå  S²  commanä  wilì  seô thå contentó  oæ  thå  seconä  memorù regisreró tï X. X remains unchanged. S<> Stop if X <> 0: Thió  commanä  ió useful iî thå middlå oæ á learned linå thaô  ió goinç tï bå executeä repeatedly®  Iô wilì causå thå executioî  tï stop if X is not zero. S= Stop if X = 0 : Thió  commanä  ió useful iî thå middlå oæ á learned linå thaô  ió goinç tï bå executeä repeatedly®  Iô wilì causå thå executioî  tï stop if X is zero. SG Set digits per group for output display of X: Thå  SÇ  commanä wilì seô thå numbeò oæ digitó peò grouð  tï  thå currenô valuå oæ X¬  anä theî Ø poppeä ofæ thå stack®  Iæ thió ió seô tï 5¬  numberó wilì bå displayeä witè á commá afteò everù 5tè digiô likå 12,34567,89000®  Iæ thió ió seô tï zero¬  1¬  oò ²  nï commaó wilì bå displayed. Š SMB Set Modulo base to X, X = 0 => no Modulo base Thió  calculatoò caî bå seô tï perforí alì oæ itó calculationó iî modulï arithmetic®  Thió ió donå bù settinç thå modulï baså tï aî integeò greateò thaî zero®  Thå SM commanä wilì seô thå valuå oæ thå modulï baså tï thå currenô valuå oæ X. SÐ Seô spacinç value¬ -1...3: Popó Ø anä useó iô tï seô thå spacinç value® Thå spacinç valuå ió initializeä  tï  twï  oî starô uð whicè causeó alì outpuô  tï  bå doublå spaced¬  onå wilì causå singlå spacing¬  ° causeó á singlå blanë characteò betweeî outputs¬ anä á -± causeó nï spacå aô all. SRÎ Storå seeä foò randoí number: Thå  SRÎ commanä storeó thå ablolutå valuå oæ Ø intï thå seeä  oæ thå randoí numbeò generator®  Aó randoí numberó arå generateä  aî 8°  biô randoí numbeò ió kepô anä useä aó thå basió foò thå  nexô randoí number® Thå valuå caî bå recordeä usinç thå RRÎ commanä aô thå  enä  oæ á sessioî anä reentereä witè thå SRÎ commanä aô  thå beginninç  oæ á ne÷ session®  Thió wilì prevenô thå  samå  randoí numbeò froí eveò beinç reused® Ø remainó unchanged. V Rotate stack down: Thió  ió thå samå aó á Poð Ø excepô thaô Ø ió alsï placeä oî  thå bottom of the stack and no stack items are lost. X Exit: The program exits back to the operating system. Y= Display = sign: Normallù  displayeä resultó arå precedeä witè aî ½ sign®  Thió ió handù  sï  yoõ caî telì wheî á calculatioî ió  completå  anä  thå displaù  conversioî ió beinç done®  Abortinç á displaù conversioî witè  thå ESà keù wilì noô affecô thå valuå computed®  Iæ  thå  ½ sigî ió noô desired¬ thå N½ commanä caî bå given® Wheî thå ½ sigî ió agaiî desireä thå Y½ commanä ió used. Reporô  anù erroró bù leavinç må á messagå oî thå OxGatå BBÓ  anä RCP/Í  systeí aô (408© 354-593´ oò calì må aô mù homå voicå phonå (408) 257-9240 evenings or weekends. Harry J. Smith 19628 Via Monte Dr. Saratoga, CA 95070