Mathdroid is an algebraic calculator that supports:
Usual operator precedence ("order of operations") is followed, and parentheses are supported.
Numbers can be given in decimal (123
), binary (0b1011
), octal (0o777
), and hex (0xfffe
).
The boolean type has two values: true
and false
.
The list type is an arbitrary sequence of values: [1, 2, 3]
.
Lists are used to represent vectors.
Lists may include nested lists, allowing the construction of matrices and tensors: [[1, 2], [3, 4]]
.
The constants e
(2.718...) and pi
(3.14...) are predefined.
The special variable Ans
returns the result of the previous calculation.
Built-in functions
There are also all the usual built-in functions. Here's an alphabetical list: $$BUILT_IN_FUNCTION_LIST$$
Where a function has an operator form, it's given in parentheses.
For example, BitShiftLeft(1, 32)
and 1 << 32
are equivalent.
Although the function names given above contain capital letters, isprime
is equivalent to IsPrime
but easier to type on phone keyboards.
If you have a convenient underscore key and value readability, you can insert an underscore between words: so is_prime
is equivalent to IsPrime
.
All trigonometric functions use radians or degrees, depending on the current angle mode setting. (See Settings.)
$$BUILT_IN_FUNCTION_HELP$$
Constants and variables
All constant and variable names, whether built-in or user-defined, are case-insensitive.
Ans
and ans
are equivalent, as are pi
and Pi
(and PI
and pI
).
You can assign to a variable with an expression like t = 4
.
It is not possible to assign a new value to a constant, nor the special variable Ans
.
Using the on-screen buttons
Most of the buttons should be familiar from pocket calculators you've used before.
The EXE ("execute") button is used to actually perform a calculation.
The EXP button is used to enter numbers in engineering notation, such as 1.2E6
, which is the same as 1.2*10^6
.
The EXP button provides the "E".
If you're using your device's keyboard, you can just type E.
The Ans button is used to refer to the previous answer.
It can be thought of as a variable whose value changes after each calculation.
For example, executing 1
and then repeatedly executing 2*Ans
will result in 1, 2, 4, 8, 16, et cetera.
The "2nd" button is used to switch the special function buttons (sin, cos, et cetera) to their second set of functions. Unlike pocket calculators, the "2nd" button is sticky; it changes to say "1st", and you have to press it again to go back. (On a pocket calculator, pressing any other button generally resets.)
If your device has a trackball, you can use that to move the caret in the text field. Otherwise, left and right cursor keys are provided.
History
A press on an item in the history copies that entry back into the input. This is useful for repeating or editing an earlier calculation.
A long press on an item in the history brings up a context menu. This menu has options to retype the selected input, copy the selected input and output to the clipboard, copy the entire history to the clipboard, forget (remove) the selected item, or forget the entire history.
Settings
Angle mode lets you choose whether trigonometric functions use degrees or radians (the default).
Haptic feedback lets you choose whether or not the device should vibrate when on-screen keys are pressed.
Continuation mode causes "Ans" to be automatically inserted when an operator (such as "*") is typed at the start of an expression. For example, in normal mode, "1*2", EXE, followed by "*3", EXE, gives an error because "*3" is meaningless. In continuation mode, the act of typing "*3" causes "Ans*3" to be inserted, giving the presumably desired result.
Why isn't this the default? Primarily because "-" is ambiguous. It's both a unary and a binary operator: the negative sign or the subtraction operator. Repeating the previous example with "-" instead of "*", typing "-3" might mean "subtract 3 from the previous result" (that is, "Ans-3"), but it might also mean "start a new calculation where the first term is -3" (as in "-3+12").
If you're in continuation mode and need to start a new calculation with "-", work-arounds include "0-3" or "(-3)". (An alternative would be for Mathdroid to exclude "-" from continuation; feedback appreciated.)
Finding out more
Mathdroid is free software. You can find the source code or report bugs at http://code.google.com/p/enh/.