All arithmetic operations are expressed in wiris using the common symbols. The symbols can be applied to the different types of mathematical objects with which wiris operates: from whole numbers to matrices.
Mathematical operations in wiris are represented by a symbol associated with a key on the keyboard. The one exception is integer division, which is carried out with a command or icon.
Some entries, such as fractions, can be represented in mathematical notation using the appropriate icons. For example, the icon allows an expression to be raised to a certain power, represented on screen as a superscript.
Finally, to facilitate entry of complex formulae, some icons are associated with keystroke combinations so they can be entered without using the mouse. In line with the previous example, it is also possible to enter an exponent by using the following keystroke combination: Ctrl + Up arrow .
The table below shows the arithmetic operations, their corresponding symbols and, where applicable, corresponding icons and keystroke combinations. It also gives and example of each operation.
Operation |
Symbol |
Icon |
Keyboard |
|
+
|
|
|
|
-
|
|
|
|
* or ·
|
|
|
|
/
|
|
Ctrl + /
|
|
^
|
|
Ctrl + Up arrow or Ctrl + Shift + ^
|
|
!
|
|
|
The symbol * always appears as in accordance with typographical convention.
The parentheses, which can be created with the (and) keys or the icon, are used in line with common mathematical conventions. They allow grouping of terms and the carrying out of operations on them. Where there are no parentheses, calculation progresses in accordance with the standard hierarchy of operations: multiplication, division, addition and subtraction, respectively. To assure operations are carried out correctly, we recommend the use of parentheses where there is any doubt about the order of operations.
If parenthesis are created with the icon, then the size of the parentheses will vary depending on the contents. The keystroke combinations Ctrl + ( and Ctrl + ) also create variable size parentheses. If the parentheses are entered by simply keying in (and), parentheses will not be of variable size. Note, however, that the functionality of both types of parentheses is exactly the same. The examples below were created using variable size parentheses.
Example: ((2-3/5)·5)3; first, the following is calculated: 2-3/5; then, the result is multiplied by 5 and this result is raised to the power of
3.
The two expressions 2/4+3*2 and (2/4)+(3*2) are equivalent. This demonstrates how the wiris icons can be used to build mathematical expressions, while avoiding ambiguities and without the need to use parentheses.
We also use parentheses to denote function arguments, although sometimes we can leave the parentheses out. Where functions have several arguments, these are separated by commas.
Below, some of the most important mathematical operations and functions are discussed. Unless otherwise indicated, they can be applied equally to whole numbers and polynomials.
quotient: command quo or quotient
Calculates the quotient of the integer division of the first argument by the second.
|
remainder: command rem or remainder
Calculates the remainder of the integer division of the first argument by the second.
|
factor: command factor
Factors the whole number and returns it as the product of prime numbers. It also factors polynomials with real coefficients.
|
prime?: command prime?
Given a whole number returns true if it is prime number and false if it is not. This function does not work with polynomials.
|
|