rpn_calculator.nrx                                             Version 1.20
  ------------------				           Copyright (c) 2005, 2006 NuukiaWorld

  This patch adds an RPN (Reverse Polish Notation) calculator in the phone.
  Everyone who is used to use advanced HP calculators know that RPN is the
  easiest way to calculate any expression, from simple to complex ones.

  For example summing a list of numbers is difficult with a standard
  calculator but in RPN you just enter the values onto the stack, and then
  execute the [+] command (i.e. double-press the Navi key) repeatedly until
  the stack contains the final sum.

  RPN tutorial: How to calculate (1+2)/(3+4) in RPN calculator?
  Enter:        1  2 Options-Add 3  4 Options-Add Options-Divide
  Result:       4.2857143E-1


  Keypad functions for each mode [similar HP48 User-RPL commands]:
  (Sn = value at stack level n):

  Normal mode:
  Navi:	Options menu
  C:     Drop one value from stack [DROP] / Exit application if empty stack
  Up:    Enter interactive stack mode
  Down:	Duplicate the value on stack level 1 [DUP]
  *:     Change sign of value on stack level 1 [NEG]
  0...9:	Digit, starts edit mode
  #:     Hash, starts edit mode for integer value

  Edit mode:
  Navi:	Options menu
  C:     Backspace / Exit edit mode
  Up:	   Add the value to the stack, and enter stack mode
  Down:	Add the value to the stack (Enter)
  *:     Change sign (of exponent if present)
  0...9:	Digit
  2:     Digits 2, A, B, C (for hexadecimal integer value)
  3:     Digits 3, D, E, F (for hexadecimal integer value)
  #:     Decimal point ('E' for exponent if point already present)
         Change radix (of integer value)

  Interactive stack mode:
  Navi:	Stack options menu
  C:     Exit interactive stack mode
  Up:    Move the pointer up in the stack
  Down:	Move the pointer down in the stack
  1:     Exit interactive stack mode (actually [1 ROLL], see the following)
  2:     Swap values S1 and S2 and exit interactive stack [SWAP]
  3:     Move value from S3 to S1 and exit interactive stack [ROT]
  4...9:	Move value from Sn to S1 and exit interactive stack mode [n ROLL]


  Options menu [similar HP48 User-RPL commands]
  (Sn = value at stack level n):

  1 Add:                   S2 + S1 [+]
  2 Subtract:		         S2 - S1 [-]
  3 Multiply:		         S2 * S1 [*]
  4 Divide:                S2 / S1 [/]
  5 Inverse:    		      1 / S1 [INV]
  6 Percentages submenu:
    6-1 % of total:        S2 * S1 / 100 [%]
    6-2 Change in %:       (S1 - S2) / S2 * 100 [%CH]
    6-3 Share in %:        S1 / S2 * 100 [%T]
    6-4 Remainder:         S2 mod S1 [MOD]
  7 Powers & roots submenu:
    7-1 Power:             S2 ^ S1 [^]
    7-2 Root:              S1th root of S2 [XROOT]
    7-3 Square:            S1 ^ 2 [SQ]
    7-4 Square root:	      Square root of S1 [root]
  8 Logarithmic submenu:
    8-1 Exponent:          e ^ S1 [EXP]
    8-2 Natural log.:      ln S1 [LN]
    8-3 Decimal exp.:      10 ^ S1 [ALOG]
    8-4 Decimal log.:      lg S1 [LOG]
    8-5 Hyp. sine:		   sinh S1 [SINH]
    8-6 Hyp. cosine:       cosh S1 [COSH]
    8-7 Hyp. tangent:		tanh S1 [TANH]
    8-8 Hyp. arcus sine:   arcsinh S1 [ASINH]
    8-9 Hyp. a. cosine:    arccosh S1 [ACOSH]
    8-10 Hyp. a. tangent:  arctanh S1 [ATANH]
    8-11 exp (x) - 1:      e ^ S1 - 1 [EXPM]
    8-12 ln (x + 1):       ln (S1+1) [LNP1]
  9 Bitwise logic submenu:
    9-1 And:               S2 and S1 [AND]
    9-2 Inclusive or:      S2 or S1 [OR]
    9-3 Exclusive or:      S2 xor S1 [XOR]
    9-4 Not:               not S1 [NOT]
    9-5 Shift left:        Shift left S2 by S1 bits [SL]
    9-6 Shift right:       Logical shift right S2 by S1 bits [SR]
    9-7 Arith. sh. right:  Arithmentic shift right S2 by S1 bits [ASR]
    9-8 Radix submenu:
        9-8-1 Decimal:     Set display radix to decimal (default) [DEC]
        9-8-2 Hexadecimal: Set display radix to hexadecimal [HEX]
        9-8-3 Octal:       Set display radix to octal [OCT]
        9-8-4 Binary:      Set display radix to binary [BIN]
  10 Trigonometric submenu:
     10-1 Sine:		      sin S1 [SIN]
     10-2 Cosine:          cos S1 [COS]
     10-3 Tangent:		   tan S1 [TAN]
     10-4 Arcus sine:      arcsin S1 [ASIN]
     10-5 Arcus cosine:    arccos S1 [ACOS]
     10-6 Arcus tangent:   arctan S1 [ATAN]
     10-7 Unit of angle submenu:
          10-7-1 Degrees:  Sets angle unit to degrees (default) [DEG]
          10-7-2 Radians:  Sets angle unit to radians [RAD]
          10-7-3 Grades:   Sets angle unit to grades [GRAD]
  11 Probabilities submenu:
     11-1 Combination      S2! / (S1! * (S2 - S1)!) [COMB]
     11-2 Permutation      S2! / (S2 - S1)! [PERM]
     11-3 Factorial        GAMMA (S1+1) [!]
     11-4 Random num.      Random number in range [0, 1) [RAND]
  12 Constants submenu:
     12-1 Pi:              Adds value of pi to stack [pi ->NUM]
     12-2 e:               Adds value of e to stack [e ->NUM]
     12-3 Sq. root of 2:   Adds value of square root of 2 to stack [2 root]
  13 Convert units submenu:
     13-1 Length           (22 units)
     13-2 Area             (12 units)
     13-3 Volume           (22 units)
     13-4 Time             (5 units)
     13-5 Speed            (7 units)
     13-6 Mass             (13 units)
     13-7 Force            (6 units)
     13-8 Energy           (10 units)
     13-9 Power            (3 units)
     13-10 Pressure        (8 units)
     13-11 Temperature     (4 units)
     13-12 Angle           (5 units)
     13-13 Illuminance     (3 units)
     13-14 Luminance       (4 units)
     13-15 Equival. dose   (4 units)
     13-16 Radioactivity   (2 units)
     13-17 Euro currency   (13 units)
  14 Dates/times submenu:
     14-1 D.MMYYYY add     S2(date) + S1(days) [DATE+]
     14-2 D.MMYYYY diff    S1(date) - S2(date) [DDAYS]
     14-3 H.MMSS add       S2(hms) + S1(hms) [HMS+]
     14-4 H.MMSS subtr.    S2(hms) - S1(hms) [HMS-]
     14-5 To H.MMSS        Convert decimal hours to h, min, and s [->HMS]
     14-6 To decimal       Convert h, min, and s to decimal hours [HMS->]
  15 Currencies submenu:
     15-1 To domestic:     S1 * rate
     15-2 To foreign:      S1 / rate
     15-3 Exchange rate submenu:
          15-3-1 Foreign unit expressed in domestic units
          15-3-2 Domestic unit expressed in foreign units
  16 Clear:                Clears the stack [CLEAR] / entered value

  Notes:
  Selecting an operator, function, or constant in the options menu while you
  are entering a value will first add the entered value to the stack and then
  execute the selected command.

  D.MMYYYY is the only date format supported. For example, 14th Feb 2006 is
  written as 14.022006.

  You can use H.MMSS functions to calculate/convert angles (in degrees-minutes-
  seconds), too. Angle 27 23' 57.32" is written as 27.235732.
  

  Interactive stack options menu [similar HP48 User-RPL commands]
  (Sn = value at pointed level):

  1 Pick:		Add a copy of Sn to the stack [PICK]
  2 Roll:		Move Sn to S1, move S1...Sn-1 up by one level [ROLL]
  3 Roll down:	Move S1 to Sn, move S2...Sn down by one level [ROLLD]
  4 Reverse:	Reverse order of S1...Sn [REV]
  5 Duplicate:	Add copies of S1...Sn to the stack [DUPN]
  6 Drop:		Remove S1...Sn from the stack [DROPN]
  7 Keep:		Remove all other values than S1...Sn from the stack [KEEP]
  8 Edit:		Starts editing of Sn


  Definition name:

  rpn_calculator


  New for 1.20
  - Fixed stack refresh if exchange rate is set during edit mode
  - Fixed the ghost cursor that appeared sometimes
  - New menus: Percentages, Probabilities, Dates/times
  - Other new functions: SINH, COSH, TANH, ASINH, ACOSH, ATANH, EXPM, LNP1
  - New unit conversion group for Euro currency
  - Decimals are rounded (instead of truncating) in bitwise logic
  - Optimized many places to save some bytes of flash
  New for 1.11
  - Fixed left shift: #1h << 31 is now #8000000h, not #7FFFFFFFh
  New for 1.10
  - Bitwise logical operators and radixes added
  - Edit line is closed before exchange rate dialog
  - Project converted to NokiX SDK V2
  - Data types optimized for 32-bit ARM registers (saves flash space)
  New for 1.02
  - action_none_back removed, was not portable and 1.0 behaviour is more
    HP48-like
  - Syntax checking added for entered values
  - Finnish messages updated to match the official HP48 Finnish message
    library FINLIB
  New for 1.01
  - You may now enter up to 15 characters when editing a value (was 14)
  - Renamed menu_close_all() to menu_reset() and shortened its pattern for
    compatibility with 3310, 3330 etc.
  - action_ok_back_close not used anymore because MSG_D_QUIT can trap menu
    closing
  - action_none_back used in case of empty edit line
  New for 1.0
  - Menu shortcuts and counter work correctly in all menus
  - No known bugs
  New for 0.5:
  - Quicker selection of angle unit with shortcut (display of last menu
    skipped)
  - Trying shortcut 10-3-x does not cause returning to main screen
  - Ending of menu shortcut mode with Back key detected now
  - Unit conversion function with 130 units in 16 groups
  - Menu counter problems not touched
  New for 0.4:
  - Updated to utilize Yak's script snapshot 22.10.2005
  - DEG/RAD/GRAD indicator
  - Long press on 'clear' if real_backspace patch is not used, fixed
  - Menu counter problems in currencies menu and after shortcut selection of
    angle unit
  New for 0.3:
  - Improved menus and shortcut processing. Problems still left in both.
  - Values between 0.0000001 and 1 are printed in scientific format if and
    only
    if it shows more significant digits (< 0.0000001 are always scientific)
  New for 0.2:
  - Shortcuts supported in the menus. Problems still left.
  - Currency functions. Problems in setting the exchange rate.
  New for 0.1:
  - The first version, problems with actions when canceling the options menu!