This is the manual for Stak. There is no manual for Stak16 yet.
Stak is a Java RPN calculator. It is currently available for Nokia Series 40 phones with three softkeys, such as the Nokia 6230. A version for desktop computers is also available.
Stak is primarily designed for mobile phones, and has a few features intended to overcome the fact that the shape and number of keys on a mobile phone is not ideal for a calculator.
Stak uses RPN (Reverse Polish Notation) on a rolling stack, like many HewlettPackard calculators. In RPN, the operands are entered before the operator, so to calculate "2 + 3" the user enters the numbers 2 and 3 then adds them. More complicated expressions, such as "4 * (3 + 5 * 7)", must be parsed by the user and entered as:
4 ENTER 3 ENTER 5 ENTER 7 * + *
Not everyone thinks this is fun, but it has several advantages, in particular for a calculator in a mobile phone.
Most calculations that can reasonably be done on a mobile phone calculator are not written down as expressions first, but comes out of understanding a specific problem, and writing them down is often an extra step.
Another big advantage is that RPN requires fewer keys than algebraic entry.
Stak has a 4level stack like classic HP calculators, not an infinite stack as in the HP48/49 (RPL) calculators. The way the enter key works also differs between the classic RPN and the RPL calculators. Stak can work either way, but defaults to the simpler way the RPL calculators use.
In this manual, the top of the stack (the one in the display of an HP calculator) is called the X register and the register above is called the Y register.
Stak uses unnormalized arithmetic as described by Mike Cowlishaw in the General Decimal Arithmetic Specification at http://www2.hursley.ibm.com/decimal/
In unnormalized arithmetic, the result of an operation remembers the number of digits in the operands. This means that while 2 + 2 is 4, 2.0 + 2.0 is 4.0. Trailing zeros can be removed with the NORM (Normalize) operation.
Stak has 15 digits of precision in the coefficient, and can work with exponents from 1013 to 999.
The asymetric exponent range is due to support of gradual underflow as specified by the IEEE 854 standard. Another effect of Stak following a standard designed for computers and not calculators is that in some situations the result of an operation can be a negative zero. It is equal to a positive zero. Zero can have an exponent like any other number, so results like 0E+3 (zero thousand) or 0.000 are not bugs.
The display consists of three parts:
A line separates the X register from the rest of the display. The status line is written in a smaller font. The two upper parts of the display are replaced in help mode or in a menu.
The status line contains information of the current state. It shows the exponent format, the current flags and the most recent operations.
The keyboard has 3 shift states, switched with the '#' key. Operations are not executed immediately when a key is pressed, but when it is released. Stak shows the operation in brackets in the status line when a key is pressed, and if it is held down the operation is cancelled (this is similar to the HP 41 calculator).
If the shift ('#') key is held down the operation is cancelled (like other operations), and a map of the keyboard in the current shift state is shown on the display. Holding shift down or executing an operation removes the keyboard map.
Keyboard layout
The first row on the map is the left and right softkeys and the up key. Second row is the left/right keys and the center key. Third row is RING, the down key and the END keys which closes the program. The remaining rows are the standard 12key phone keyboard.




Stak enters a special memory mode for storing and recalling values from memory. In memory mode a register (out of 100) is selected, either with the up/down keys or by entering a number, and then an operation is choosen. All the mathematical operations are available. Unary operations, such as 1/X are performed on the register, and binary
Operations, such as + or / are performed on the register and the X register, with the result in the register.
The argument history list is an extension of the "Last X" function in HP's calculators. Instead of just the last value in the X register, it stores the last 100 arguments used in operations in a list, where they can be recalled just like memory values. Binary operations are available, they work on the value in the X register and the element in the history list.
In memory or history mode some of the keys in the first three rows are different:


Some functions are disabled in memory or history mode. They are grayed out in the keyboard map.
The MODES dialog contains these items:
Format  'All' or 'Fixed'. Show all digits or with a fixed decimal. 
Show dec.  How many decimals to show in Fixed format. This option is hidden if the format is All. All digits are shown, with exponent if necessary, if the number is too large or is rounded to zero. If the number is rounded a tilde '~' is shown in the left column. Default is 2. 
Exp. format  SCI or ENG. Exponential notation is used if the exponent of the value is larger than zero or the exponent of the highest digit of the value is larger than 6. 
Dec. sep.  The decimal separator can be '.' (full stop) or ',' (comma). 
1000 sep.  The thousands separator can be '.' (full stop), ',' (comma), "'" (apostrophe) , ' ' (space) or none. 
Time sep.  Time separators can be '0:0:0.0', '0°0'0"0' or '0h0hm0s0' 
Digits  Switch the digit set between up to 18 different, depending on the character sets supported by the phone (in practice much less than 18). The supported digits are: European, ArabicIndic, Eastern ArabicIndic (Persian and Urdu), Bengali, Devanagari, Gujarati, Gurmukhi, Kannada, Khmer, Lao, Malayalam, Mongolian, Myanmar, Oriya, Tamil, Telugu, Thai, and Tibetan 
Trig mode  Switch between degrees and radians 
Stacklift  The stack lift (enter key) can be Classic, as in HPs RPN calculators, or New, as in RPL calculators. 
Stack size  Depth of the stack, from 4 (default) to 16 
Values can be toggled with the left softkey or reset to the default value with the RING key.
Entering values  
< and > begins editing of the value in the X register. CLEAR clears the X register and blocks the stacklift, so a new entry overwrites the 0 in the X register.  
0..9  Digits. May look different if alternative digits are chosen in the Modes dialog 
', EEX' or '. EEX'  Decimal separator/Enter exponent. Press once to enter decimal separator, twice to enter exponent. How the decimal separator looks depends on the setting in the Modes dialog. The default is a guess based on the country setup of the phone. 
'::.'  Enter time separator. Depends on setting in the Modes dialog. Hours, minutes and decimal minutes can be entered by pressing the decimal separator key after entering minutes. 
<  Move the entry point ('_') to the left 
>  Move the entry point to the right 
BSP  Delete to the left of the entry point 
Stack  
RUP  Roll the stack up 
RDN  Roll the stack down 
X<>Y  Swap X and Y registers 
CLEAR  Clear X register 
ENTER  Finish entry of a value or copy the X register 
Navigation  
MEM  Switch to memory mode 
HIST  Switch to history mode 
MODES  Open the modes menu 
SYS  A menu with operations to clear various things, and an about box. 
Back  Return from menus or from memory/history mode 
Undo/redo  
UNDO  Undo an operation. The undo buffer has room for several hundred operations. Undone operations are added to the redo buffer. 
REDO  Redo next undone operation 
Register operations  
STO  Store value in current register 
RCL  Recall current register or history value 
X<>R  Swap X register and current register 
Arithmetic  
+  Addition 
  Subtraction 
*  Multiplication 
/  Division 
CHS  Change sign 
RMD  Remainder. For negative arguments, this operation may return negative results, unlike the mathematical modulus operator. 
1/X  Inverse 
SQRT  Square root 
INT  Integer part 
Conversion operations  
These operations work as on the HP32SII and HP33S calculators. They convert the value in the X register to another unit. The Temperature conversions convert absolute temperatures.  
>kg  Pound to kg 
>lb  Kg to pound 
>F  Celcius to Fahrenheit 
>C  Fahrenheit to Celcius 
>cm  Inch to cm 
>in  Cm to inch 
>l  Gallons to liter 
>gal  Liters to gallons 
Time operations  
The time operations get the current time, or convert between time and decimal hours, minutes or seconds. If the X register is a time value, it is converted to a number, and numbers are converted to time values. Note that conversion from time to hours or minutes may be inexact, because 1/60 cannot be represented exactly as a decimal number.  
HOUR  Convert time to decimal hours or vice versa 
MINUTE  Convert time to decimal minutes or vice versa 
SECOND  Convert time to decinal seconds or vice versa 
TIME  Get current time as a time value. 
Invalid entry  The digit or separator was not accepted because the value would not be valid (too big etc.) 
Overflow  The result is larger than 1E100 
Divide by 0  The result of a division is infinite 
Division undefined  0 / 0 has no result 
Domain error  Square root of a negative number etc. 
Quantization error  Quantization not possible 
Invalid operation  Other invalid operation 
Stack view:
Inexact  '~' is shown if the last result is inexact (e.g. 1/9 = 0.111...) 
Angle mode  DEG or RAD is shown depending on the angle mode 
Operation  The last operation executed, or preview of the next operation 
Memory view:
View  MEM 
Position  Current position (099) 
Operation  The last operation executed, or preview of the next operation 
Argument history view:
View  ARGS or ARGM (argument history to memory) 
Position  Current position (from 0 to depth  1) 
Depth  Depth of argument history (099) 
Operation  The last operation executed, or preview of the next operation 
Stak is written by Gunnar Degnbol. Comments and bug reports are welcome at
gdegnbol at tiscali dot dk