Documentatioî foò RPNMF.COM Thió documenô applieó tï versioî 1.2b of RPNMF 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: *** RPNMF *** Version 1.2b, April 28, 1984 Copyright 1984 by author Harry J Smith, Saratoga, CA Reverse Polish Notation Multi-precision floating point calculator Has a stack of four 1001 decimal digit numbers with a dynamic range of +/-9.9 ... 9 * 10 ** +/-39453 Press ESC to interrupt a long calculation or display Bytes in mantissa = 12 Max digits in display = 3344 Bytes to truncate in x for display = 2 Rounding is ON Base = 10 base ten, Max digit = 9 **** PRESS ANY KEY TO CONTINUE OR ^C **** n Enter a number ! X factorial " Start/stop comment field " CC...C" * Multiply ** X = Y ** X Power + Add - Subtract / Divide 1/X X = 1.0 / X ? 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 EXX Execute X times I Interchange X and Y **** PRESS ANY KEY TO CONTINUE OR ^C **** 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 RN Generate a random number, 0.0 <= X < 1.0 RON Round results ROF Do not round results 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 SD Set # of digits in display to X (1 - 3344) SG Set digits per group for output display of X SM Set # of bytes in mantessa to X (2 - 418) SP Set spacing value, -1...3 SRN Store seed for random number **** PRESS ANY KEY TO CONTINUE OR ^C **** ST Set # of bytes to truncate for display to X (0 - 418) V Rotate stack down X Exit Y= Display = sign = 0.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: Herå  î referó tï keyinç iî aî numbeò likå ° oò  12345.6789®  Thå numbeò  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.678,9^-1,²  ió  á legaì inpuô number. ¡ Ø factorial: Replaceó  Ø witè thå factoriaì oæ Ø ½ ± ª ² ª ³ ª ..®  ª X®  Onlù thå integeò portioî oæ Ø ió useä iî thå calculation. ¢ 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. ª Multiply: Poð Ø anä Y¬ Pusè Ø timeó Y. *ª Ø ½ Ù *ª Ø Power: Poð Ø anä Y¬  Pusè Ù tï thå poweò oæ X®  Onlù thå integeò portioî oæ the power Ø ió useä iî thå calculation. « Add: Poð Ø anä Y¬ Pusè suí oæ Ø anä Y. - Subtract: Poð Ø anä Y¬ Pusè Ù minuó X. ¯ Divide: Poð Ø anä Y¬ Pusè Ù divideä bù X. 1/X X = 1.0 / X: Poð ج Pusè 1.0 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å  valueó currentlù seô bù thå SM¬  SD¬  ST¬  RON¬  ROF¬ anä  commandó arå displayeä. Á 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ó (!¬  *¬  **¬  +¬ -¬ /¬ 1/X¬ B¬ R¬ S¬ SD¬  SM¬  anä ST© 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Î 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ï 10943¡ iæ yoõ waiô lonç enough® Hiô thå ESà keù twicå tï interrupô anä aborô thå operatioî iæ yoõ geô tireä oæ 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å parameteró seô bù thå B¬  ROF¬ RON¬ SD¬ SM¬ SRN¬ anä SÔ commandó arå reseô tï theiò nominaì values, and all registers are cleared. R Square Root: Ø ió replaceä witè thå squarå rooô oæ X® R1 Recall memory register 1: Š Besideó  thå stacë anä lasô Ø therå arå twï memorù registeró thaô caî holä anù numbeò 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. RN Generate a random number, 0.0 <= X < 1.0: Thå RÎ commanä generateó á randoí numbeò betweeî zerï anä 1.° anä pusheó iô untï thå stack®  Thió numbeò wilì neveò havå morå  thaî 8°  significanô bits®  Theoreticallù thå randoî numbeò  generatoò wilì  cyclå  afteò ² *ª 8° numbers¬  buô thå eartè wilì noô  lasô thaô long. RON Round results: Thió commanä setó roundinç on® Wheî roundinç ió oî thå resultó oæ alì  arithmetiã  operationó arå roundeä tï thå maximuí numbeò  oæ byteó iî mantissa®  Uså thå SÍ commanä tï seô thå maximuí  numbeò oæ byteó iî mantissa. ROF Do not round results: Thió commanä setó roundinç off®  Wheî roundinç ió ofæ thå resultó oæ alì arithmetiã operationó arå truncateä tï thå maximuí  numbeò oæ  byteó  iî  mantissa®  Uså thå SÍ commanä tï seô  thå  maximuí numbeò oæ byteó iî mantissa. RRN Recall random number or seed: Aó  randoí numberó arå generateä aî 8° biô randoí integeò 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®  Carå musô bå takeî tï ensurå thaô thå  numbeò oæ byteó iî mantissá ió seô tï aô leasô 1°  anä  thaô thå  unitó  portioî  oæ  Ø ió beinç displayeä wheî  thå  seeä  ió recorded. 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ù numbeò 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. SD Set # of digits in display to X (1 - 3344): Thå  SÄ commanä wilì seô thå maximuí numbeò oæ digitó tï  displaù tï thå currenô valuå oæ X¬ anä theî Ø ió poppeä ofæ thå stack® Iæ thió  ió  seô largeò thaî thå accuracù implieä bù thå  numbeò  oæ byteó  seô bù thå SÍ commanä minuó thå numbeò oæ byteó seô bù thå SÔ  command¬  thå  smalleò valuå wilì bå useä  tï  determinå  thå numbeò oæ digitó tï display. 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î Ø ió poppeä ofæ thå stack®  Iæ thió ió  seô tï 3¬  numberó wilì bå displayeä witè á commá afteò everù 3rä digiô likå 1.234,567,89^34,457®  Iæ thió ió seô tï zero¬ ± oò 2¬ nï commaó wilì bå displayed. SM Set # of bytes in mantessa to X (2 - 418): Thå  SÍ commanä wilì seô thå maximuí numbeò oæ byteó iî  mantissá portioî oæ anù floatinç poinô valuå useä iî oò resultinç froí anù opperatioî oæ thå calculator® Wheî thió valuå ió seô tï á smalleò valuå  thaî waó currentlù set¬  alì floatinç poinô valueó iî  thå calculatoò arå truncateä tï thió numbeò oæ byteó oæ precisioî  iî their mantissa. X is popped off the stack. SP Set spacing 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. SRN Store seed for random number: Thå SRÎ commanä storeó thå integeò portioî oæ thå ablolutå  valuå oæ  Ø  intï thå seeä oæ thå randoí numbeò  generator®  Aó  randoí Šnumberó  arå generateä aî 8° biô randoí integeò 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. ST Set # of bytes to truncate for display to X (0 - 418): Thå  SÔ  commanä  wilì seô thå numbeò oæ byteó  tï  truncatå  foò displaù  tï thå currenô valuå oæ X¬  anä theî Ø ió poppeä ofæ thå stack® Iæ thå numbeò oæ digitó tï display¬ seô bù thå SÄ commanä ió largeò thaî thå accuracù implieä bù thå numbeò oæ byteó seô bù thå  SÍ commanä minuó thå numbeò oæ byteó seô bù thå SÔ  command¬ thå  smalleò valuå wilì bå useä tï determinå thå numbeò oæ digitó to display. 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