On a previous page, you learned the Shwa numerals and signs. On this page, we'll discuss the symbols needed to express basic arithmetic.

In English, we use **+** to separate numbers being added together, but when we enclose a total in a larger expression, we have to surround it with parentheses or brackets, as in **[4+3]**. In Shwa, we simply draw a line over a sequence of expressions - numbers or larger formulas - to indicate that they should be added together, with dots separating the expressions.

The second example shows little decorations I'll call *valances* at each end of the overline. We sometimes use
them to make it clearer where the overline begins and ends.

The **two-dimensional (2D)** format above is how the formula should be written or displayed, but when an
expression is read aloud or entered on a keyboard, you need its **one-dimensional (1D)** format:

In the 1D format, we just enter the correct valances, and the renderer should complete the overline.

To indicate subtraction, we insert a vertical line __before__ the number(s) being subtracted. In the 2D format, the vertical line hangs from the overline. You can subtract individual numbers or expressions no matter where they are in the sequence, even first - this is the correct way to indicate the negation of an expression (the negative sign is for negative numbers).

Multiplication works just like addition, except the line is underneath.

Finally, division uses the same vertical line, but sitting on the underline. As with subtraction, you can divide individual numbers anywhere in the sequence.

Division can be used to indicate the reciprocal of __any__ expression (the fraction sign can only be used with integers).

These four operations can be combined without fear of ambiguity (and without precedence rules).

We read the English expression **3²** as *three squared* or *three to the second power*: **3**
is the *base*, **2** is the *power* or *exponent*, and the operation is called *exponentiation*.
When using keyboards, the same expression is often written **3^2**, since most keyboards can't write superscripts.

In Shwa, we link the base and the power with a diagonal step that goes __over__ the base and __under__ the
power, which can occur in either order.

If 9 is *3 squared*, then 3 is the *square root* of 9, the number which, when squared, reverts to the
original. Just as we use a vertical line to mark subtraction and division, the reverse operations of addition and
multiplication, we use a vertical line with exponentiation to mark roots. The square root is mathematically equivalent
to the one-half power.

Roots are the __reverse__ operation of powers, but logarithms are the __inverse__ operation of powers, in the
sense that if **bª = c**, then **a = log _{b}(c)**. Shwa uses the same notation to indicate logs as it
does for powers and roots, but this time with a vertical line in front of the

All of the above can be combined into formulas. Here's a complicated example - the quadratic formula in 2D format.
I've used the letters **p t k** to represent the coefficients of the quadratic **px² + tx + k = 0**, whose
roots are the solutions to the formula.

__-t + √(t² - 4pk)__

2p

(It's not correct to use **±** before the root, since both square roots
are added - one of them just happens to be negative.)

As the above formula shows, Shwa also uses letters within formulas to spell the names of constants, variables and functions.

By convention, one-letter names are used for temporary names like the variables in the quadratic formula above, while customary names get longer meaningful abbreviations. For example:

**tor**= 2π ≈ 6.28318, the ratio of the circumference of a circle to its__radius__(not its diameter!). The abbreviation derives from the Greek word τόρνος, for*a turn*(e.g. on a lathe).

For a discussion of why Shwa chooses 2π, or**τ**, for its circle constant, please visit Pi is Wrong and The Tau Manifesto .**oy**=*e*≈ 2.71828, the base of the natural logarithms :*e*is its own derivative. The name honors the Swiss mathematician Leonhard Euler (^{x}*eu*is pronounced**oy**in German).**pen**= φ ≈ 1.61803, the "golden ratio", which is the ratio of*a*to*b*such that*a/b = (a+b)/a*. The abbreviation**pen**derives from its close association with pentagons and pentagrams.- Common trigonometric functions:
**sin**= sine;**cos**= cosine;**tan**= tangent;**sec**= secant;**csc**= cosecant;**cot**= cotangent; - By the way, angles are expressed in Shwa as fractions of a full circle, not as radians or degrees. One full
circle is called 1
**Torit**, abbreviated**To**. For example, an angle of**π radians**or**180°**would simply be a Shwa angle of**½ Torit**or**0.5 Torit**or simply**To1*5**.

Unlike some computer languages, Shwa doesn't include digits in names. That's because any letters in front of
numbers, with no spaces, are **units** - units always go ahead of numbers in Shwa. For example, **kg1°81**,
with no spaces, is how we write 81 kilograms.

We use low tone marks and the Long mark __within__ compound unit names:

- The Level tone mark replaces the underline of multiplication
- The Rising tone mark replaces the diagonal step of exponentiation
- The Long mark replaces the vertical line of division

For example, *man-hours* would use the Level mark, *square meters* would use the Rising mark, and *
kilometers per hour* would use the Long mark.

Note the use of magnitude notation: these are all real numbers, not integers.

Functions not only have names; they also have *arguments*, parameters being passed to the function. For
example, the famous trigonometric functions *sin(p) cos(p) tan(p)* all require an angle *p*. In Shwa, we use
a *box* notation for the function and its arguments, separated by spaces. If the result of one function is
an argument to another, the boxes may nest, as shown below.

The next three sections deal with natural arithmetic, in which there are no negative or real numbers. The operators all use a doubled vertical line.

A doubled subtraction sign is used as a unary prefix to indicate a positive number, or the **Absolute Value** of a
number (the number without the sign).

The **difference** sign is used between numbers to indicate a special form of subtraction whose result is always
positive: difference. For example, we say that New York is the same distance from San Francisco as San Francisco is
from New York, not its negative.

The two **Modulo** functions - **quotient** and **modulus** - are a variant of division. The main use of
these functions is to perform conversions of numbers from one form into another: into integers, real numbers, or
multiples of a modulus. In the expressions **a quot b** or **a mod b**, **a** is called the *dividend*
and **b** is called the *divisor*. The result of *quot* is called the *quotient*, and the result of
*mod* is called the *modulus* or *remainder*.

If the dividend and divisor are both *natural numbers* (positive integers, including zero), then the quotient
and remainder are also both natural numbers, and the following three properties hold:

- The quotient
**a quot b**is always an integer - The remainder
**a mod b**is always smaller (closer to zero) than the divisor**b**(unless the divisor is zero!) - The dividend equals the divisor times the quotient plus the remainder:
**a = b × (a quot b) + (a mod b)**

For example, consider **7÷4**. Using normal (real) division, the result is **1.75**, and if you
multiply the divisor by the quotient, you get the dividend: **7 = 4 × 1.75**. But using modular division, the
quotient would be **1** with a remainder of **3**, and **7 = 4 × 1 + 3**.

When the dividend and divisor aren't both natural numbers, the results are more complicated, but the same three
properties always hold. When the divisor is negative, so is the remainder. When the dividend or divisor is real, so is
the remainder. When the divisor is 1, the remainder is the fractional part of the number: 0 ≤ *r* < 1. When
the divisor is zero, so is the quotient but not the remainder (and the division is valid)!

The two signs are used more often than you might think, for dates and times, for example, or to separate numbers into
integer+fraction, or real+imaginary, or larger+smaller than an arbitrary size. For instance, if you want to know how
many 8-packs of hot dog buns you'll need for five 6-packs of hot dogs, it's **(5×6) quot -8** (the divisor is
negative so the remainder is negative: leftover buns).

Shwa offers symbols for seven *equalities*. They're double-wide, and centered in a four-wide space.

The **equal** sign is represented in Shwa by a big double-wide T, showing the two sides are balanced:

The **unequal** sign is the same T, but upside down:

These two signs combine to form the four **inequalities**:

There is also a sign for **approximate equality**, which is sometimes used as a general symbol for ambiguity.

There is a different sign for **equivalence**, which means "not identical, but equal in some quality". For
example, this is the relationship between the two square roots of negative 1. It might be used outside of arithmetic to
match corresponding items, e.g. English *cat* ↔ French *chat*.

Finally, there is a sign for **assignment** or **definition**, which means "the value of the expression on the left
is being assigned to the item on the right". Note that in Shwa, the assignment goes from left to right.

And here's the same thing in 1D form, as you would type it on a keyboard:

To recap, here are all the symbols in the Shwa script :

All these symbols are available on the keypad, in Formula mode.

To shift into Formula mode, use the √ key followed by the Formula mode key:

That's all you need to write Shwa!

If you're interested, the link at right below leads to a set of pages describing another number system, the balanced dozenal or *Janus* numbers, and a metric system based on them. They are an example of a very different numeric "language" that the Shwa script enables. But you don't have to learn them
to use Shwa, any more than you need to learn Zulu or Inuktitut to write English in Shwa.

< Numerals | Janus Numbers > |

© 2002-2016 Shwa | shwa@shwa.org | 03oct16 |