- Scientific
- Statistical
- Financial
- Programmable
- Graphing
- Complex arithmetic
- Matrix/vector arithmetic
- Unit arithmetic
- RPN

**Current version: 4.52**, change-log

**Copyright: 2003-2009 Roar Lauritzsen**, roarl at users sourceforge net

**Demo:** Click here
to open a demo applet for reference while reading the documentation

**Development and patches:** Join the development effort at http://sourceforge.net/projects/midp-calc,
where the source is available under the GPL license

**Contribute:** If you find this program useful, you can inspire
to future work by donating e.g. $10 here:

Calc works much like a good old HP calculator with RPN logic, but the stack has 16 elements and you can see many of the elements on the stack simultaneously. I have chosen to use RPN logic (Reverse Polish Notation), because operating it requires less keys, you need only ENTER instead of "(", ")" and "=". Additionally, being able to store and see intermediate results on the stack is very advantageous.

Using the Real Java floating point library, Calc has 63 bits internal precision, which amounts to approximately 19 decimal digits accuracy, considerably

http://midp-calc.sf.net/Calc.jad, or

http://midp-calc.sf.net/Calc.jar

http://midp-calc.sf.net/CalcNokia.jad, -.jar

http://midp-calc.sf.net/CalcMIDP2.jad, -.jar

http://midp-calc.sf.net/CalcSiemens.jad, -.jar

I have noticed one thing when upgrading with my SonyEricsson K700i, which might apply to other phones as well. After downloading, the phone says "The new version may be from another source. Trust source?". If I don't answer "yes", the program memory is cleared.

→ → Older versions

The following MIDP phones/devices have been tested with Calc v3.00 and later versions:

**Sony Ericsson T630**^{1}**, Z520i**^{1,N}**, Z525a, Z600**^{1}**, Z800**^{1,2,N}**, Z1010, W600i, W800i**^{1,2,N}**, W810, W810i, W850i, K300i**^{1}**, K510i, K550i, K610i**^{1,2,N}**, K700i**^{1,2,N}**, K750i, K800i, P1i**^{1,N}**, P990i**^{1,2,N}: Tested OK**Sony Ericsson M600i**: Tested OK. Awkward entering of numbers, ENTER and +, but the menu works fine using the touch-screen.**Nokia 3220**^{N}**, 3230**^{1,N}**, 5140i, 5500**^{N}**, 6020**^{N}**, 6060**^{N}**, 6103, 6220**^{N}**, 6230i**^{1,2,N}**, 6233**^{N}**, 6265**^{1,N}**, 6300, 6600**^{1,N}**, 6630**^{1,N}**, 6670**^{1,N}**, 6680**^{1,2,N}**, 6681**^{1,N}**, E60**^{1,2,N}**, N70**^{1,2,N}**, N73, N80**^{1,2,N}**, N95**^{N}: Tested OK**Nokia N-gage**: Only showing half the screen**Nokia E71**: Problem with keyboard input**Motorola Razr V3**^{1}**, V180, V195, V220, V547**^{1}**, V557, C380, C390, C650**: Tested OK**Siemens A65**^{1,S}**, C75**^{2}**, SX1**^{1,N}**, AX72**^{S}**, S65**: Tested OK**BenQ-Siemens EF81**: Tested OK**Samsung Z500**^{1,2}**, SGH-D407, SGH-t519, SGH D600 SGH-X100**^{1}**, X-820**: Tested OK**Samsung E900**: Tested almost OK. Problem with HEX input**LG U880**^{2}**, LX260**^{2}: Tested OK**Sharp 770sh**^{1}: Tested OK**Palm Zire 72**: Tested OK. By using IBM's WebSphere Everyplace Micro Environment it should run on every device that's supported by the VM, e.g. Palm's Tungsten T5, Tungsten E2, LifeDrive or Treo 650**BlackBerry 8820**^{S}: The only issue is that ENTER and + are not displayed, and "yes" and "no" are not shown during setup.**BlackBerry 9000**: Only the 2.08 version works.

(if nothing is specified, I have not received detailed enough information)

Please drop me a note about your experiences if you have tested Calc on a device that is not on the list, or if your experiences were different than what is listed. Remember that nearly all devices can have different versions of "firmware" (the "operating system"), and that upgrading the firmware at your local repair shop may improve many compatibility issues.

(The phones are not sorted in any specific order)

**Table of contents:**- Keys
- Setup
- RPN logic
- Menu
- Operations
- Basic
- Math
- Trigonometric
- Bitwise operations
- Special
- Stack
- Memory
- Statistical
- Financial
- Conversions and constants
- Time and date
- Unit arithmetic and conversions
- Scientific constants

- Mode
- Number
- Programming
- Base
- Monitoring
- System

- Notes
- Abnormal results
- Complex arithmetic
- Matrix arithmetic
- Unit arithmetic
- Financial calculation
- Date calculation
- Constants
- Programming
- Graph drawing
- Binary representation
- Monitor editing mode

**0-9**: The number keys are used to enter numbers and as shortcuts when activating operations that take a number argument ("STO", "FIX", etc). In hexadecimal mode, you can enter the digits A-F by holding down the keys 1-6 until the digit changes.*****: This key is used to enter the decimal point.**#**: This key is used to enter a minus sign or an "e" for exponent. (In HEX/OCT/BIN mode, the same key can be used to enter a "/". This sign is used to prefix a negative two's complement number and should be read as "an infinite number of 1-bits preceding the number". Pressing the # key again exchanges the "/" with a normal minus sign, indicating the input of a normal negative number which will be converted to two's complement on ENTER.)**clear, 'c'**: This key deletes the last digit in an entered number, clears the lowest element on the stack, and backtracks through menus.**ENTER**: This key finishes the currently entered number and puts it on the stack. If no number is being entered, the lowest element on the stack is duplicated.**+**: This key adds the two lowest elements on the stack.**Joystick/arrow keys**: Pressing the middle of the joystick activates the menu. Pressing up/down/right/left on the joystick activates the corresponding sub-menu directly (you don't need to press the middle of the joystick first). Sub-menus are entered by further navigation with the joystick until an actual operation is activated. If your phone supports pointer input, you can also activate the menu by clicking the middle of the screen.**Hangup/Back**: All devices have some key that exits the application, most often it is called "hangup", "back", "return" or has a symbol of some sort to this effect. On some devices, e.g. K700i, you must press and hold the button for several seconds. The state of the calculator will be saved in memory until the next time.

First, to make sure that "ENTER" and "+" is immediately available, Calc will rotate through a set of command-key mappings until you answer "yes" to the question if you see "no" mapped to the left soft-key and "yes" mapped to the right soft-key simultaneously (These keys are located left and right directly below the display). Some phones may for instance map "yes" and "no" to a menu named "Options" on the left side, with nothing on the right side. If you select "yes" when such a mapping is active, your "ENTER" and "+" key will be accessible in the same cumbersome manner. (In the Nokia version, this screen is skipped.)

Second, to make sure that a "clear" or "c" key is available (and recognizable by the application), you will be asked to press it. If you do not have a "clear" key, press "#" instead - this will be your clear key, and "*" will be used to magically enter both minus sign, decimal point and exponent marker. On some Motorola phones the "menu" button can be used as "clear".

(If you have downloaded the Nokia version, be extra careful at this point. If your phone has a "joystick" or direction keys with an

The third setup item is font selection. For color devices, Calc uses sub-pixel anti-aliasing to improve the visibility of numbers displayed on screen. However, some phones uses different pixel ordering (BGR instead of RGB), and then the numbers may look strange. Select the font that looks best on your device (beware that the commands "left" and "right" may be mapped to the right and left command key respectively, if you chose that setting in the first screen). Some phones may have a 90 degrees rotated screen where the red, green and blue color cells are stacked vertically instead of horizontally. There is no support for such screens, so on these devices the numbers will always look bit strange, unless you select the "system" font.

If your phone does not have a 5-way joystick, most times on Nokia you can use the "dial" button instead of the middle joystick button. If you only have a two-way joystick or none at all, the number keys 2, 4, 5, 6 and 8 will work as joystick keys once a menu is activated. In that case, you can only hope that the menu will be activated by "dial" or some other button, otherwise you will be stuck.

The basis for implementing RPN logic in this calculator is a stack of numbers. The stack is initially empty, and when you write a number and "ENTER" it on the stack, the stack grows upwards with the latest entered number at the bottom of the stack. If you start to enter another number, the numbers already on the stack jump up to make room for the new number. To make the stack shrink, you can either clear the lowest element on the stack using the "clear" key, or you can combine the two lowest elements on the stack using a mathematical operation.

The lowest element on the stack is called "x". In operations with one argument, such as "sin", x is used as input and is replaced by the result. The rest of the stack remains the same. The element above x on the stack is called "y". In operations with two arguments, such as +,-,* and /, the x and y stack elements are removed from the stack and the result is placed on the stack instead, as the new x. The rest of the stack moves down one step. Sometimes the element above y is called "z".

For instance, to calculate 3+7, one would press the following sequence of keys: 3, ENTER, 7, +. The result, 10, will now be the lowest element on the stack, ready for further calculations. To calculate 3*(2+4), one would press the following sequence of keys: 3, ENTER, 2, ENTER, 4, +, *. (To access the "*" operator, you really need to press the key "↑" to enter the "basic" arithmetic menu, followed by "←", to select the multiplication operator.)

This is what the display will look like as you enter the sequence of keys above, assuming that you start with an empty stack:

Keystrokes: "3" "ENTER" "2" "ENTER" "4" "+" "*" Stack: | | | | | | | | | | | | | 3.00 | | | y: | | | 3.00 | 3.00 | 2.00 | 3.00 | | x: | 3_ | 3.00 | 2_ | 2.00 | 4_ | 6.00 | 18.00 |

Notice that you don't need to press "ENTER" after the "4" (but you

A more thorough RPN tutorial can be found here, except that the "ENTER" key works as in the HP RPL system.

↑ | ||||||||

← |
→ |
|||||||

↓ | ||||||||

→ |
→ |
→ |

Once you've familiarized yourself with the layout, you don't need to press the middle joystick button to activate the main menu. Pressing up/down/right/left on the joystick without activating the main menu first activates the corresponding sub-menu directly. In this way, you can reach the most used "ENTER" and "

Some operations require a number argument ("STO", "FIX", etc). When such an operation is activated, a two-level number menu is entered, enabling the selection of a number between 0 and 15. When this number menu is active, you can access the numbers 0-9 directly using the number keys.

Since the middle joystick button can be a bit difficult to press, care has been taken not to place the most used operations and sub-menus on the middle button. Pressing "clear" (the button, not one of the menu entries) while navigating the menus backtracks up one level of menus.

**-**: Subtract x from y*****: Multiply x and y**/**: Divide y by x**+/-**: Change sign of x: As a shortcut, this menu position repeats the last operation selected from one of the other menus. Some operations (e.g. "clear stack/mem/stat/finance") will not be repeated**repeat**

- Simple
**1/x**: Calculate the reciprocal of x**x²**: Calculate the square of x**√x**: Calculate the square root of x**%**: Calculate x percent of y. This operation leaves y standing, so you can add or subtract the result directly using + or -. To add 24% to 42, press "42", "ENTER", "24", "%", "+"**%chg**: Calculate percentage of change from y to x, i.e. 100·(x-y)/y

- Power
**e**: Calculate the natural exponential^{x}**ln**: Calculate the natural logarithm**y**: Calculate y to the power of x^{x}: Calculate the x'th root of y^{x}√y**10**: Calculate 10 to the power of x^{x}**log**: Calculate base-10 logarithm of x_{10}**2**: Calculate 2 to the power of x^{x}**log**: Calculate base-2 logarithm of x_{2}

- Probability
**P y,x**: Calculate number of permutations (ordered subsets) when x elements is taken from a population of y**C y,x**: Calculate number of combinations (unordered subsets) when x elements is taken from a population of y**x!**: Calculate the factorial of x. For non-integer values, Γ(x+1) is calculated**Γx**: Calculate the gamma function**erfc**: Calculate the complementary error function, 1-erf(x), equal to the integral from x to infinity of 2/√π ·e^{-t²}dt.**erfc**: Calculate the inverse erfc function^{-1}**phi**: Calculate the normal distribution probability density function (equal to erfc(-x/√2)/2).**phi**: Calculate the inverse phi function^{-1}

- Matrix
**(*)**- Create matrix
**new**: Create new matrix with y rows and x columns**→M**: Build a new matrix with dimensions selected from submenu, using elements taken from the stack. Before executing the operation, enter the matrix elements to the stack, a_{11}first, then a_{12}, one row at a time. You cannot undo this operation**→row**: Build a new row matrix with dimension selected from submenu, using elements taken from the stack. You cannot undo this operation**→col**: Build a new column matrix with dimension selected from submenu, using elements taken from the stack. You cannot undo this operation

- Matrix parts
**split**: Split matrix in y at row or column specified by x. If x is positive, matrix is split horizontally after x rows. If x is negative, matrix is split vertically after -x columns**col**: Pops the column number off the stack, then pushes a copy of the x'th column, taken from the_{x}*lowest*matrix on the stack**row**: Pops the row number off the stack, then pushes a copy of the x'th row, taken from the_{x}*lowest*matrix on the stack**a**: Pops the column (x) and the row (y) off the stack, then pushes the element identified by this row and column, taken from the_{yx}*lowest*matrix on the stack**break up**: Break up the matrix in x and push the individual elements on the stack. You cannot undo this operation, although the previous matrix is stored in "LAST x". This operation does the opposite of the "→M", "→row" and "→col" operations.

- Combine matrices
**concat**: Concatenate matrix in y and matrix in x. Plain numbers can be concatenated into row vectors**stack**: Stack matrix in y on top of matrix in x. Plain numbers can be stacked into column vectors

- Matrix math
**det**: Calculate determinant of matrix in x. (This operation is just as slow as calculating the inverse by "1/x")**Tr**: Calculate the trace of matrix in x, i.e. the sum of all the elements along the diagonal**A**: Transpose matrix in x^{T}**A**: Transpose and conjungate matrix in x^{T}**abs**: Calculate the Frobenius norm of matrix in x, i.e. the square root of the sum of the squares of all the matrix elements. For row and column vectors this calculates the length of the vector**a**: Finds the matrix element with the maximum value, taken from the_{max}*lowest*matrix on the stack**a**: Finds the matrix element with the minimum value, taken from the_{min}*lowest*matrix on the stack**size**: Pushes the number of rows and columns of the*lowest*matrix on the stack

- Create matrix
- Miscellaneous
**mod**: Calculate y modulo x, i.e. subtract (or add) x from y until the remainder is between 0 and x. Works the same for negative x. Actually, y-x·floor(y/x).**div**: Complementary to mod it calculates how many times x must be subtracted from y to get a remainder between 0 and x. Actually, floor(y/x)**random**: Calculate a random number uniformly distributed in the range [0.0, 1.0)**factorize**: Find greatest prime factor of x (integer input less than 2^{63}). This factor and the original number divided by the factor is placed on the stack... repeat! If input is not integer, it is rounded. If the factorization is difficult (x > 2^{31}), it will give up after 5 seconds and push the greatest factor found so far (might be 1). The interrupted state is saved so if you repeat it will continue trying.**gcd**: Calculate the greatest common divisor of x and y (integers < 2^{63}). If inputs are not integer they are rounded.**prime?**: Test if x is prime (integer < 2^{63}). If x is prime, 1 is pushed, otherwise 0. If input is not integer it is rounded.**→prime**: Find next prime greater or equal to x (integer < 2^{63}). If input is not integer it is rounded.- Integer operations
**round**: Round x to nearest integer**ceil**: Round x towards positive infinity**floor**: Round x towards negative infinity**trunc**: Remove fractional part of x (round towards zero)**frac**: Remove integer part of x, i.e. calculate x-trunc(x)

- Normal
**sin**: Calculate the sine of x**cos**: Calculate the cosine of x**tan**: Calculate the tangent of x

- Arc
**asin**: Calculate the arc sine of x**acos**: Calculate the arc cosine of x**atan**: Calculate the arc tangent of x

- Hyperbolic
**sinh**: Calculate the hyperbolic sine of x**cosh**: Calculate the hyperbolic cosine of x**tanh**: Calculate the hyperbolic tangent of x

- Arc hyperbolic
**asinh**: Calculate the arc hyperbolic sine of x**acosh**: Calculate the arc hyperbolic cosine of x**atanh**: Calculate the arc hyperbolic tangent of x

- More
**R→D→G**: Rotate between radians, degrees and grads as measure of angles. 2π radians = 360 degrees = 400 grads.**→RAD**: Convert from degrees to radians**→DEG**: Convert from radians to degrees**π**: Enter the number π- Rectangular/polar coordinates
**r→p**: Convert rectangular coordinates (x,y) to polar (x=radius, y=angle)**p→r**: Convert polar coordinates (x=radius, y=angle) to rectangular (x,y)**atan**: Calculate the arctangent of y/x, in the range -π to π (or -180 to 180 in DEG mode, -200 to 200 in GRAD mode)_{2}**hypot**: Calculate √x²+y²**r→cplx**: Convert rectangular coordinates (x=re, y=im) to complex number

- Complex numbers (available instead of coordinate menu if x or y
is complex)
**(*)****cplx→r**: Convert complex number to rectangular coordinates (x=re, y=im)**abs**: Calculate absolute value (complex modulus) of complex number**arg**: Calculate angle (complex argument) of complex number in the range -π to π (or -180 to 180 in DEG mode, -200 to 200 in GRAD mode)**conj**: Calculate complex conjugate

**and**: Calculate bitwise AND of x and y**or**: Calculate bitwise OR of x and y**xor**: Calculate bitwise XOR of x and y**bic**: Bit-clear, clear all bits from y that is set in x, i.e. calculate y AND NOT x**y<<x**: Shift up y by integer number of bits in x**y>>x**: Shift down y by integer number of bits in x**not**: Invert all bits in x. Fractional bits are ignored, i.e. the calculated value is x XOR -1

- Stack
**LAST x**: Recall value of x before last operation**undo**: Undo previous stack operation. Memory, statistical and financial operations, in addition to clear stack, cannot be undone. In operations involving both stack and one of the other modules, such as x↔mem, only the stack is restored**x↔y**: Exchange x and y elements of the stack**rolldn**: Roll stack down (rolling with as many elements as is currently in the stack)**rollup**: Roll stack up**RCL st#**: Copy any stack location into x**x↔st#**: Exchange x with any stack element (y is element 1)**move dn#**: Move down any stack location into x. This is equivalent to a**rollup**operation where only the (n+1) lowest stack elements are involved.**move up#**: Move x up to any stack location. This is equivalent to a**rolldn**operation where only the (n+1) lowest stack elements are involved.**clear**: Clear the stack

- Memory
**STO**: Store x in memory location**STO+**: Add x to memory location. (Useful with memory monitoring for keeping score in a game ;-)**RCL**: Recall memory location**x↔mem**: Exchange x with any memory location**clear**: Clear memory

- Statistical
**Σ+**: Add x and y to statistics**Σ-**: Subtract x and y from statistics**clear**: Clear statistics- Results
- average
**x,y**: Calculate mean x and mean y values, i.e. Σx/n**xw**: Calculate mean of x values weighted by the y values, i.e. Σxy/Σy**s**: Calculate sample standard deviation of x and y values, i.e. [Σ(x-x)²/(n-1)]_{x},s_{y}^{½}**S**: Calculate population standard deviation of x and y values, i.e. [Σ(x-x)²/n]_{x},S_{y}^{½}**draw**: Draw data points and plot average

- Linear regression: y=ax+b
**a,b**: Calculate coefficients, x=a, y=b**y**: Calculate estimated y for current x^{*}**x**: Calculate estimated x for current y^{*}**r**: Calculate correlation coefficient**draw**: Draw regression curve along with data points

- Curve fitting: y=a·
*ln*x+b**a,b, y**: (see linear regression)^{*}, x^{*}, r

- Curve fitting: y=b·e
^{ax}**a,b, y**: (see linear regression)^{*}, x^{*}, r

- Curve fitting: y=b·x
^{a}**a,b, y**: (see linear regression)^{*}, x^{*}, r

- average
- Sums
**n**: Recall number of statistics entered**Σx**: Recall sum of x'es**Σx²**: Recall sum of squared x'es**Σy**: Recall sum of y's**Σy²**: Recall sum of squared y's**Σxy**: Recall sum of x·y product**Σ**: Recall sum of*ln*x*ln*x**Σ**: Recall sum of*ln*²x*ln*²x**Σ**: Recall sum of*ln*y*ln*y**Σ**: Recall sum of*ln*²y*ln*²y**Σx**: Recall sum of x·*ln*y*ln*y**Σy**: Recall sum of y·*ln*x*ln*x**Σ**: Recall sum of*ln*x*ln*y*ln*x·*ln*y

- Financial
**(*)****STO**: Store x in financial register (pv, fv, np, pmt, ir%)**RCL**: Recall financial register (pv, fv, np, pmt, ir%)**solve**: Solve one financial value with respect to the others**pv**: The*present value*in an account**fv**: The*future value*after a certain number of payment periods**np**: The*number*of payment*periods***pmt**: The amount of each periodic*payment***ir%**: The*interest rate*on the account per period (in percent)

**clear**: Clear financial registers**END/BGN**: Switch between end of month payments and beginning of month payments**y%*x**: Interest multiply. Convert from nominal x-times-a-year (e.g. monthly) interest rate to effective annual rate**y%/x**: Interest divide. Convert from effective annual interest rate to nominal x-times-a-year rate

- Conversions and constants
- Time and date
**(*)****→H**: Convert x, interpreted as date, hours, minutes and seconds (format`yyyymmddHH.MMSS`) to hours. If year (`yyyy`) is zero, the format is instead understood as`ddddHH.MMSS`, where`dddd`is number of days.**→DH.MS**: Convert x from hours to date, hours, minutes and seconds. If x ≤ 8784 hours, it is instead converted to the format`ddddHH.MMSS`, where`dddd`is the number of days.**now**: Get current date and time in DH.MS format. Useful to remind yourself how this format is**time**: Get current time only in DH.MS format**date**: Get current date only in DH.MS format**DH.MS+**: Add x and y as date, hours, minutes and seconds**DH.MS→unix**: Convert from`yyyymmddHH.MMSS`format to unix time**unix→DH.MS**: Convert from unix time to`yyyymmddHH.MMSS`format**DH.MS→JD**: Convert from`yyyymmddHH.MMSS`format to Julian Day**JD→DH.MS**: Convert from Julian Day time to`yyyymmddHH.MMSS`format**DH.MS→MJD**: Convert from`yyyymmddHH.MMSS`format to Modified Julian Day**MJD→DH.MS**: Convert from Modified Julian Day time to`yyyymmddHH.MMSS`format

- Unit arithmetic and conversions
**(*)****unit***: Multiply x with a unit selected from one of the submenus (listing):- spatial: Submenu containing units with
*length*as the primary factor; length, area, volume, speed and acceleration. - firm: Submenu containing units with
*mass*as the primary factor; mass, force, energy, effect and pressure. - other: Submenu containing other units; time, temperature, chemical and electric.

- spatial: Submenu containing units with
**unit/**: Divide x by a unit selected from a submenu. The unit submenus are the same as for**unit***.**→unit**: Convert the unit of x (as far as possible) to the unit selected from a submenu. The unit submenus are the same as for**unit***, with the following additions:**SI**: Convert to base SI units.**US/Imp**: Convert to base US/Imperial units, using lb and ft for mass and length respectively.

**clear**: Clear the unit from the number in x**describe**: Describe why the unit of the number in x shows as "[err]" or describe if it is a composite built up from more basic units.

- Scientific constants
**(*)**- Universal
**c**: Enter the speed of light in a vacuum ≡ 299792458 m/s**h**: Enter the Planck constant ≈ 6.62606896·10^{-34}J·s**µ**: Enter the permeability of a vacuum, ≡ 1.256637061435917...·10_{0}^{-6}N/A²**ε**: Enter the permittivity of a vacuum ≡ 8.854187817620390...·10_{0}^{-12}F/m

- Chemical
**N**: Enter the Avogadro constant ≈ 6.02214179·10_{A}^{23}mol^{-1}**R**: Enter the molar gas constant ≈ 8.314472 J/mol·K**k**: Enter the Boltzmann constant ≈ 1.3806504·10^{-23}J/K**F**: Enter the Faraday constant ≈ 96485.3399 C/mol

- Physical and electromagnetic
**α**: Enter the fine-structure constant ≈ 0.0072973525376**R**: Enter the Rydberg constant ≈ 10973731.568527 m_{∞}^{-1}**a**: Enter the Bohr radius ≈ 5.2917720859·10_{0}^{-11}m**µ**: Enter the Bohr magneton ≈ 9.27400915·10_{B}^{-24}J/T

- Atomic
**e**: Enter the elementary charge ≈ 1.602176487·10^{-19}C**m**: Enter the mass of an electron ≈ 9.10938215·10_{e}^{-31}kg**m**: Enter the mass of a proton ≈ 1.672621637·10_{p}^{-27}kg**m**: Enter the mass of a neutron ≈ 1.674927211·10_{n}^{-27}kg**m**: Enter the unified atomic mass unit ≈ 1.660538782·10_{u}^{-27}kg

- Astronomical
**G**: Enter the Newtonian constant of gravitation ≈ 6.67428·10^{-11}m³/kg·s²**g**: Enter the standard acceleration of gravity ≡ 9.80665 m/s²_{n}**A.U.**: Enter the length of one astronomical unit ≡ 149597870691 m**l.y.**: Enter the length of one light year ≡ 9460730472580800 m**pc**: Enter the length of one parsec ≡ 3.085677581305729...·10^{16}m

- Universal
**guess**: Guess and display the formula for the number in x. The calculated guess is pushed on the stack. This function can guess formulas of the following types: a/b, √a/b, (a/b)^{(1/3)}, aπ/b, aπ²/b, a/(bπ), a/(bπ²), e^{(a/b)}, 2^{(a/b)}, ln(a/b) and log_{2}(a/b), where a and b are integers less than 2³¹. The probability estimate is only correct given that no*other*type of formula fits even better, such as (a±√b)/c.

- Time and date

- Number
**normal**: Set normal number mode, shows all digits but removes trailing zeros**FIX**: Set fixed-decimal number mode, shows a fixed number of digits after the decimal point**SCI**: Set scientific number mode, shows a fixed number of digits after the decimal point in scientific format**ENG**: Set engineering number mode, shows a fixed number of digits after the decimal point in engineering format, i.e. exponent is a multiple of 3- Separators
- point
**.**: Display the decimal point as a period**,**: Display the decimal point as a comma**keep**: Keep the decimal point even if no fraction is shown**remove**: Remove the decimal point if no fraction is shown

- thousand
**. or ,**: Display thousands separator as period or comma (depending on decimal point)**space**: Display thousands separator as space**'**: Display thousands separator as '**none**: Display no thousands separator

- point

- Programming
**(*)****new**: Start entering a new program**append**: Append commands to an existing program**run**: Run a program**clear**: Clear a program**draw y=f(x)**: Draw program function y=f(x). Prior to using this operation, you should enter x_{min}, x_{max}, y_{min}and y_{max}on the stack, in that order. See note on graph drawing.**draw r=f(θ)**: As above, but this time the program calculates a polar graph r=f(θ), where the input is the angle and the output is the radius. Input will be in range [0,20π], i.e. 10 "rounds".**draw z=f(t)**: As above, but this time the program calculates a parametric curve z=f(t), where the input t is in the range [0,1] and the output is a point in the (complex) plane**draw z=f(z)**: As above, but this time the program calculates a complex number z_{o}=f(z_{i}), where the input z_{i}is a complex point in the plane delimited by x_{min}, x_{max}, y_{min}and y_{max}. For each point in the plane, the result is drawn so that the intensity varies according to the absolute of z_{o}modulo 1, and the color varies according to the the angle (complex argument) of z_{o}.**integrate**: Integrate program function f(x). Prior to using this operation, you should enter the integration limits a and b, and the desired accuracy on the stack, in that order. a and b may be complex**diff.**: Differentiate program function f(x). Prior to using this operation, enter the x you want to differentiate for, which may also be complex**solve**: Solve program function f(x), i.e. find a root where f(x)=0. Prior to using this operation, enter**two**limits x_{1}and x_{2}on the stack, so that f(x_{1})·f(x_{2})<0**min/max**: Find local minima or maxima in program function f(x). Prior to using this operation, enter**two**limits x_{1}and x_{2}on the stack, so that at the mid-point between x_{1}and x_{2}, the function f((x_{1}+x_{2})/2) is either greater or less than both f(x_{1}) and f(x_{2}).

- Programming 2 (available while entering a new program)
**finish**: Finish entering current program**reset**: Reset the current program (purge and start from beginning)- Flow control (when recording a program, these operations will have no
effect whatsoever)
- Label related operations
**LBL**: Set label. The label, numbered 0-15, can used as a destination for**GTO**or**GSB**from somewhere else in the program.**GTO**: Goto label. Program execution jumps to the specified label and continues. In case of multiple matching labels, the label to go to is first searched for forwards in the program. If the label is not found, the program is searched backwards from the**GTO**instruction until the label is found. If no label is found, the program terminates with an error message.**GSB**: Goto subroutine. This operation is similar to**GTO**, except that the current position in the program is saved, so that a subsequent**RTN**instruction will return the program to the current position to continue execution. Recursive**GSB**operations are permitted, up to 16 levels deep.**RTN**: Return from subroutine. Continues execution from the next operation following the last**GSB**operation. If there has been no previous**GSB**operation executed, program execution will instead stop.**STOP**: Stop program execution. If the program is used e.g. in an integration operation, the current value of x will be used as the output of the program, and the integration itself will not stop.

- Looping operations
**ISG**: Increment, skip if greater. The specified memory location is interpreted as a counter, according to the format`ccccc.fffii`, where`ccccc`is the current counter value,`fff`is the final counter value, and`ii`is the increment. When the operation is executed, the value of`ccccc`is incremented by`ii`, and if`ccccc`is then greater than`fff`, execution skips the next line of the program and continues. If`ii`is 00, an increment of 01 will be used instead.**DSE**: Decrement, skip if equal. The specified memory location is interpreted as a counter as with**ISG**, but instead of incrementing,`ccccc`is decremented by`ii`, and if`ccccc`is then equal to (or less than)`fff`, execution skips the next line of the program and continues.

- Comparing x and y
**x=y?**: Execute next program line only if x exactly equals y, otherwise program execution skips the next line of the program and continues.**x!=y?**: Execute next line if x does not equal y, otherwise skip**x<y?**: Execute next line if x is less than y, otherwise skip**x<=y?**: Execute next line if x is less than or equal to y, otherwise skip**x>y?**: Execute next line if x is greater than y, otherwise skip

- Comparing x and 0
**x=0?**: Execute next line if x exactly equals 0, otherwise skip**x!=0?**: Execute next line if x does not equal 0, otherwise skip**x<0?**: Execute next line if x is less than 0, otherwise skip**x<=0?**: Execute next line if x is less than or equal to 0, otherwise skip**x>0?**: Execute next line if x is greater than 0, otherwise skip

- Label related operations
- Utility operations for programming
**abs**: Calculate absolute value of x**max**: Select maximum value of x and y**min**: Select minimum value of x and y**select**: Select y or z based on x, i.e. calculate x·y+(1-x)·z. When selection criterion x exactly equals 1 or 0, y or z is copied directly instead of calculating it. This enables selecting away`inf`'s and`nan`'s. If x contains a square matrix, X·Y+(I-X)·Z is calculated.**sgn**: Keep only the sign of x as ±1. With this you can e.g. simulate "abs" by pressing "ENTER", "sgn", "*". Also ±0 becomes ±1

- Indirect memory operations for programming
**RCL[x]**: Recall memory location indirectly, using x as index (must be between 0 and 15).**STO[x]**: Store**y**in memory location indirectly, using x as index.**STO+[x]**: Add**y**to memory location indirectly, using x as index.

- Base
**(*)****DEC**: Set decimal (base-10) number mode**HEX**: Set hexadecimal (base-16) number mode**BIN**: Set binary (base-2) number mode**OCT**: Set octal (base-8) number mode

- Monitoring
**(*)****mem**: Monitor first*n*memory locations in upper part of the display**stat**: Monitor first*n*statistical registers**finance**: Monitor financial registers**matrix**: Monitor*n*rows from the*lowest*matrix on the stack**off**: Turn monitoring off (equivalent to set a monitor to display*n=0*lines).

When in program recording mode, this command is replaced by:**prog**: Activate the program editing monitor (monitor*n*consecutive lines of the program)

- System menu
- Fonts
**number**: Select number font from the submenu:**small**: Small built-in font**medium**: Medium built-in font**large**: Large built-in font**xlarge**: Extra large built-in font**xxlarge**: Extra extra large built-in font**xxxlarge**: Extra extra extra large built-in font**sys.S**: Small system font**sys.M**: Medium system font**sys.L**: Large system font

**menu**: Set menu font. Same submenu as for number font. (Although it is possible to select, the "small" font is not suitable for use in menus.)**monitor**: Set monitor font. Same submenu as for number font

**fullscreen**: Toggle full screen operation (supported only by MIDP 2.0 version)**ver.**: Enter the current version number on the stack**exit**: Exit the application. The the stack, memory, statistics, finance and programs will be saved until next time**reset**: Reset the application and exit. All setup information, all values saved in the stack, memory, statistics, finance and all programs will be erased. You will be asked for a confirmation. Use this operation if you have gone through the setup dialogs and picked the wrong settings

- Fonts

Abnormal numbers are often fine to use in further calculations. In most cases where the final result would be meaningful, abnormal numbers accomplish this. For instance,

Examples of operations with abnormal numbers are:

Any operation involving

Most operations that logically extend to complex arguments have been implemented for complex numbers, i.e. all basic operations, all simple operations except "%chg", all power operations and all trigonometric operations. For convenience, integer operations (rounding and truncation) work on the real and imaginary part of the complex number separately.

All stack and memory operations handle complex numbers transparently. Financial and statistical modules cannot store complex numbers, so with these modules only the real part of the numbers are stored/used. Any operations that are undefined for complex numbers or that have not been implemented yet, returns

If either x or y contains a complex number, any operation in the "coord" sub-menu is undefined (the sub-menu dealing with rectangular/polar coordinates). In this case the "coord" sub-menu is exchanged with a sub-menu called "cplx" for dealing with complex numbers.

Complex numbers are (like the value

Complex operations work strictly in radians, so when the input is complex (i.e. it has a non-zero imaginary part), operations involving the angle of the complex number (i.e. most trigonometric and power functions) will automatically cause a switch from degrees (DEG) or grads (GRAD) to radians (RAD).

Complex numbers are displayed on one line as e.g. 2+3i. Since two numbers are displayed simultaneously, the display may not be wide enough to display both numbers if you are using a large font and the numbers have large exponents. Instead "

Most operations that logically extend to matrix arguments have been implemented for matrices, i.e. all basic operations, "1/x", "x²", and "y

All stack and memory operations handle matrices transparently. Financial and statistical modules cannot store matrices, so with these modules a matrix is treated as

Matrices are displayed on one line as e.g. "M:[3x4]". This indicates a matrix of 3 rows and 4 columns. A 1x1 matrix is automatically converted to a normal number. Matrices can contain complex numbers and some complex operations are supported. Matrices can not contain numbers with units, and not other matrices. With a matrix on the stack you can press "mode/monitor/matrix" to view and edit the

Apart from these limitations, it is the limitations of the host (i.e. you phone) that may be the most severe. When creating especially large matrices you may experience "Out of memory error". If you get this, is advised to exit the program to avoid further errors which may be caused by this. There may also be a limit to how much matrix data the calculator can save when you exit. If the calculator was unable to save all the matrices, some of your matrices will be replaced by

Matrices are stored by reference, so copying a matrix many times on the stack or in memory does not consume memory, it only copies the reference. However, changing a matrix will create a new matrix, even for such a simple operation as "+/-". Since the old matrix is still backed up in "LAST x" you are temporarily using twice as much memory as with just the one matrix.

Unit arithmetic works for most operations that logically extend to arguments with units, i.e. all basic operations, simple operations, and "y

All stack and memory operations handle units transparently. Financial and statistical modules cannot store units so with these modules the units are ignored. For operations that are undefined for units or that have not been implemented yet, the units are also ignored.

The calclator supports many different units, also different units for the same physical property. For instance, there are 13 different units for length. All units are composed of, and can be reduced to 6 base units; length, mass, time, temperature, charge and the chemical unit "mol".

A particular unit may contain several base units raised to varying powers (e.g "m/s²"), and for each base unit a particular unit variant (e.g. "kg" or "lb" for mass) will be in use. A unit may also contain powers of higher order units. A higher order unit is a unit that represents a composite of more than one base unit, but cannot be decomposed to the base units without a conversion factor. For instance, an "acre" represents "length" raised to the power of 2, but it is not composed of any particular "length" unit such as "m". As with the base units, there can be variants of a higher order unit as well, for instance there are 12 higher order units that all represent "volume". The calculator contains as many unit variants and higher order units as has been practically attainable.

It is possible to do do arithmetic on numbers with different units, but it may be necessary to reconcile the units before the calculation can take place. If an operation takes two arguments and the units of x and y are different, the unit of y is first converted to the unit of x. Then the value of y is scaled according to the ratio of the unit conversion before the operation is executed.

For operations that require the same type of unit in x and y, e.g. addition, the unit of y must be fully converted to the unit of x. If this is not possible, the operation takes place as if the units were not present, and the unit of the result is displayed as "[err]". For other operations, e.g. multiplication, only the parts of the units that represent the same physical property will be reconciled. For instance, "1 m/s" in y, multiplied by "1 h" in x, becomes "3600 m", since y is first converted to "3600 m/h".

Units are displayed directly behind the numbers on the stack. For brevity, if a unit contains more than one base unit raised to a negative power, the units are joined by a "·" after the "/" without surronding parentheses, e.g "8.314472 J/mol·K" (meaning "J/(mol·K)"). Additionally, when displayed, many common unit combinations will be reduced and replaced with a symbol representing a composite unit. For instance, the unit "kg·m²/s²" will be displayed as "J", without actually changing the existing unit into a "higher order" unit or anything. More complex units may be reduced several times before they are displayed. The logic behind this reduction tries to construct the most compact form while maximizing the meaning of the displayed form. For instance, the unit "kg/s³" is displayed as "W/m²", because square meters are more logical than cubic seconds. It is possible to see which base units a reduced unit represents by using the operation "conv/unit/describe".

Imperial units that have the same spelling as an American unit are presented in the menus and displayed on screen in

When a unit error or overflow has occurred, the unit is displayed as "[err]" or "[ofl]", respectively. If such a unit is used in combination with another unit, the result will also be "[err]". On the other hand, if an "[err]" or "[ofl]" unit is combined with another "[err]" or "[ofl]" unit, or is combined with a number without a unit, the unit will simply "evaporate" and disappear.

SI prefixes such as "k" for "kilo-" and "m" for "milli-" are not generally supported for all units, just in some special cases due to common usage. It is worth noting that most prefixed units, such as "kW", are "higher order" units in the same manner as "hp", and will usually survive intact (i.e. not be decomposed) in calculations. For instance, "1 kW" multiplied by "2 h" becomes "2 kW·h". On the other hand "W" is a "reduced" unit; simply a shorter way of displaying the underlying unit "kg·m²/s³". When multiplying "1 W" (in y) by "2 h" (in x), the unit factor "s

Here is a complete listing of all the units.

[* This business of dividing an interest rate by 12 is not mathematically correct, but since the banks use this procedure it is wise to do it also, otherwise your numbers will not agree with those of the bank. To calculate the nominal monthly interest rate from an effective annual interest rate, use the "y%/x" operation, which actually calculates 100·(

If you solve repeatedly and successively for each of the financial registers, the values may start to drift away from the original values because of inaccuracies during the calculations.

When converted to hours, a date is represented by the number of hours since the imaginary date January 1st year 0 (in the extrapolated Gregorian calendar). Negative dates are not interpreted as years BC, but are instead represented as a negative amount of time equal in magnitude to the date interpreted as a positive number. In this way, you can subtract dates by entering a negative date and using "DH.MS+". However, it is impossible to extrapolate the Gregorian calendar to years BC.

When converting from date-time format (

Beware that you must specify the year with all four digits. If you specify a year with two digits only, you will be calculating dates in a Gregorian calendar extrapolated to the years AD 1-99 (*). As an intermediate result such dates are fine (e.g. a time interval, resulting from a DH.MS+ operation with one negative operand), but the result should be converted to hours or added to a proper date before it is meaningful. If an intermediate result like this represents a time interval less than one year, it will be converted to the form

[* leap years in this period matches leap years in the period 1900-1999, so you may get away with it. On the other hand, the year 100 (in the extrapolated Gregorian calendar) was

If year is nonzero, and month (

Because a date-time value is represented with many digits, inexact intermediate representation may cause inaccuracies to escalate. To alleviate this, some magic rounding has been implemented so that e.g. 99 minutes and 99.999 seconds is instead interpreted as 1 hour, 0 minutes and 0.000 seconds. This will catch a majority of the problems that may occur.

The calendar conversions routines were taken from http://www.fourmilab.ch/documents/calendar/

Unix time measures seconds since midnight (00:00 UTC) on January 1st, 1970. Many operating systems and languages (including Java) use this time scale, although many use a local time zone instead of UTC. Use "DH.MS→unix" and "unix→DH.MS" to convert dates to/from this time scale.

Astronomers often use Julian Day or Modified Julian Day as a practical format for doing arithmetic with dates. The Julian Day is the number of days elapsed since noon on Monday, January 1st 4713 BC (in the Julian calendar). Use "DH.MS→JD" and "JD→DH.MS" to convert dates to/from this time scale.

The Modified Julian Day is the number of days elapsed since midnight (00:00 UTC) on November 17, 1858. Use "DH.MS→MJD" and "MJD→DH.MS" to convert dates to/from this time scale.

Beware that this calculator has no notion of time zones, it takes whatever value the Java environment returns (through System.currentTimeMillis()). If you are in a different time zone than UTC, you may have to add or subtract some hours to get a perfect unix, JD or MJD time value.

Pressing "STO" in this mode will copy x into the current monitor element. Pressing "RCL" in this mode extracts the current monitor element and pushes it on the stack. Pressing the middle joystick button pops one element off the stack, stores it in the current monitor element, and exits the editing mode so you can enter or calculate the next number. All these operations also have the side effect of advancing to the next monitor element below (or in the next column if you are at the bottom). Pressing "clear" will exit the editing mode.

As of version 4.00, Calc is fully programmable with control flow and looping. When program recording has been activated (i.e. after executing "prog/new" or "prog/append"), all activity is recorded in the current program, but the calculator looks and behaves exactly as before except a "PRG" indicator to the upper right. There is no limit to the size of a program, but beware, do not leave Calc in programming mode (look for the "PRG" indicator), because Calc will

Using the "undo" operation does not remove any statements from the program, it only adds the "undo" operation to the program as well. Instead, use the program editing mode described below to remove an operation. Advice: If your program is complex, plan the steps beforehand on a piece of paper.

Programs can be viewed or edited using the program editing monitor command: "monitor/prog":

The program editing monitor can be used to view or edit programs. Note that the program editing monitor can only be accessed in the programming mode and as usual the number of lines to display have to be chosen. As the other monitor modes, it has a display mode and an editing mode (accessed by the

A program is called a

When

When

When

When

When

Graph drawing, integration, differentiation, solving, min/max-ing and calling other programs recursively cannot be programmed, as well as commands on the "System menu".

Here are some programming examples.

To save battery, you can stop program drawing using the "*" key when you are satisfied with the look of the graph. If some parts of the axes are obscured by the graph, the axes can be refreshed using the "0" key. If drawing is stopped, another hit on the "0" key draws the numbers along the axes as well.

When drawing is stopped, the graph can be zoomed using direction keys (or the corresponding number keys). Zoom in using the middle button or "5". Zoom out using "1". To restart drawing, press "*" again. Zooming can also be used when drawing statistics. After the zoom function has been used, the values x

Negative numbers are displayed as a generalized form of "twos complement", with the following interpretation: Negating the number inverts all bits, including an infinite number of 1-bits before the radix point and an infinite number of 1-bits after the radix point. The infinite number of 1-bits before the radix is represented by an "f" prefix (or 7 or 1 in OCT and BIN modes). The infinite number of 1-bits after the radix is rounded upwards producing an infinite number of 0-bits, until the first 0-bit is encountered which will be switched to a 1 (rounded or not, these two forms are mathematically equivalent). For example, the number "1", inverted, will become (in binary mode) ...1111110.111111.... Rounding of the infinite number of 1's after the radix gives the number ...1111111.000000..., which is exactly the way we usually see "-1" as two's complement.

Bitwise operations with negative numbers (and, or, xor and bic) use the generalized "twos complement" representation of the number when interpreting the bits. However, beware that normal rounding that occurs when the display cannot display all the significant digits of a number may cause inexact values to appear different in the display than their internal representation.