How to use abakus
Prev
Next

Chapter 2. How to use abakus

Basic usage

The basic synposis is: Type your expression, and hit Enter. abakus will calculate the value of what you typed and display it on the screen. You can use many functions from mathematics, and even define your own functions. You can also define and use variables.

You can define your own functions in abakus. To do so, at the expression prompt, you would type something like: set funcname(var) = expr and hit Enter. If all went well abakus will simply output OK, and you'll see your function appear in the user-defined function list. Now you can use your function as normal. If you'd like to remove your function, you can either right-click on it in the user function list and select Remove Function, or enter remove funcname() in the expression prompt and hit Enter. Note that you don't enter the variable name in the parentheses since only the function name is needed. (The reason you still need the parentheses is because your variables can have the same name as a function).

You can also define your own variables. abakus comes with the basic mathematical constants pi (π) and e (Euler's Constant) defined by default. To define your own variable, at the expression prompt you would type: name = value, or set name = value. You will then see your variable in the list of variables. To remove your variable, either right-click on it in the list and select Remove Variable, or enter remove varname in the expression prompt. Notice that there are no parentheses this time. ;-)

Placeholder Variables

You may have noticed that when you type in expressions, abakus will show a value beginning with $ (such as $0) after the result. This is a placeholder variable. What happens is that the most recent result is always $0. The result directly before is $1, and so on. You may use the placeholder values in your expression to avoid having to re-type it or use the drag-and-drop. Note that there is a special variable defined called ans, which is the same as $0. In other words, whenever you want to reference the last expression's result, you can use $0 or ans.

Decimal Precision

abakus supports high-precision arithmetic using Ariya Hidayat's hmath code from his excellent calculator SpeedCrunch. You can change the displayed precision by using the View Menu, where you can select between Automatic precision, or some pre-defined precision levels. You can also select Custom precision to select your own precision (between 0-75 digits).

Operators

abakus supports all the standard operators like -, +, *, and /. It also supports both the ^ and ** symbols to mean exponentiation. Exponentiation is right-associative in abakus, meaning that 2^3^2 will return 512 instead of 64. (2^(3^2)). Operator precedence is performed as in mathematics as well (e.g. 2 + 3 * 2 and 3 * 2 + 2 both return the same answer). abakus also supports parentheses to group expressions for when the default operator precedence is invalid.

Functions

abakus has quite a few functions built-in:

  • sin, cos, tan: Trigonometric functions. Supports Degrees and Radians mode.

  • asin, acos, atan: Inverse trigonometric functions. Supports Degrees and Radians mode.

  • abs: The absolute value of a number.

  • sqrt: Square root of a number.

  • ln / log: Logarithms. ln uses the "natural base", e, which log uses base 10.

  • exp: Exponential. Returns e to the given power. exp(x) is equivalent to e^x.

  • round, ceil, floor, int: Converts an answer to an integer. ceil rounds to the next highest integer, while floor rounds to the next lower. int simply drops the fractional part. round rounds to the nearest integer.

  • frac: Returns the fractional part of a number.

  • sinh, cosh, tanh: Hyperbolic trigonometric functions.

  • deriv: Returns the numerical derivative of the given expression. The graphical interpretation of a derivative is the slope of the given function, at the given point. It is used like this: deriv(exp, pt). Note that since deriv takes two arguments that the parentheses are required to avoid ambiguity. For most functions, the value that deriv returns will be exact (at least within the bounds allowed by the underlying decimal representation).

Prev
Next
Home