Magic Number

Icon

Sticky Operators

Less bracketing. More speed.

What are they?

Let’s say you want to calculate 11 + 33 / 2

It’s natural to type  ‘11 + 33 / 2’.

But doing so gives you 11 + 33/2

As division has higher precedence than addition, it acts like glue —
it bonds 33 and 2.

As a workaround, we use parentheses,  ( 11 + 33 ) / 2.
While workable, it’s also unnatural and slows us down.

Ideally we want ‘+’ to act upon 11 and 33.
We want it to bond 11 and 33.
We want it to be sticky.

How?

⌥ (option) is the key

Or rather, ⌥ is the sticky key.

To enter a sticky ‘+’,  press  + 

So to calculate 11 + 33 / 2

just enter  11   ⌥ +  33  /  2

Sticky Operator Add

Subtraction

As you have guessed, the shortcut is  – 

For example: 33 - 11 / 2

Enter:  33   ⌥   11  /  2

Sticky Operator Subtract

(Don’t go away yet. There is a little twist in our story.)


Multiplication

To avoid confusion with the standard multiplication sign ‘×’, the lower-case x,
and the upper-case X, Magic Number uses the dot ( • ) notation from math.

Shortcut:  . 

Example:  To convert 3600 minutes into days, we want

Sticky Operator Multiply

For that, we enter  3600  /  60   ⌥ .  24


Division

No drama here, the shortcut is /

Previously, to calculate
8^2/3
you had to use parentheses, 8 ^ (2 / 3).

And now,  8 ^ 2   /  3.

Sticky Operator Divide

What’s next?

You are almost an expert.
With the next 2 tips, you can handle any sticky situation.

Sensing sticky

With great power comes great responsibility…

When you have  2 × 3 + 4 = 14, and without knowing ‘+’ is sticky, you might think something is wrong. How can you tell something is sticky?

Let’s look at standard and sticky operators side by side.

Addition

Standard

2 x 3 + 4

Sticky

2 x 3+4

Subtraction

Standard

2 x 3 - 4

Sticky

2 x 3-4

Multiplication

Standard

2 x 3

Sticky

2 · 3

Division

Standard

2 ÷ 3

Sticky

2 / 3

See the bond

You can also tell by double-clicking the operator.
This selects the operator and its operands as a group.

Standard

2 x 3 + 4
Left operand2 × 3  =  6
Right operand4
Left + Right10

Sticky

2 x 3+4
Left operand3
Right operand4
Left + Right7

Avoid misunderstanding

Whether it is for someone or for your future self, parentheses are still essential to make your expressions understandable.

Here is a quick way to bracket a sticky for clarity:

1. Double-click to select it as a group.

Sticky Group Selected

2. Press ⌘ )  or  ⌘ ]  to bracket the group.

Sticky Group Bracketed

Semi-sticky

There are times you need a less sticky operator.
To see why, let’s start with the standard ‘+’.

Enter  √ 3 + 4  and you get

√ 3 + 4

For comparison, let’s try the sticky ‘+’.
Enter  √ 3 ⌥+ 4

√ 3+4

You can see sticky ‘+’ bonds directly to 3.
That is, it bonds directly to whatever comes before it.

To get a better insight, enter  8 ^ 2 ⌥+ 3

8 ^ 2+3

As expected sticky ‘+’ bonds directly to 2.
This is better than entering  8 ^ (2 + 3).

However when dealing with expressions like

√(3²+4²)

Using a sticky ‘+’ for  √ 3 ^ 2 ⌥+ … yields

Too sticky

And using a standard ‘+’ doesn’t help either.

Not sticky at all

You are stuck.
Sticky ‘+’ won’t do as it bonds with 2 — it’s too sticky.
Standard ‘+’ won’t do as it bonds with √ 3 ² — it’s not sticky.

You need something in between.
You need a semi-sticky ‘+’ that bonds with 3 ².

You can achieve that by pressing ⌥+ twice.
That is, by entering  √ 3 ^ 2  ⌥+ ⌥+  4 ^ 2.

Less sticky

Your turn

Well done for getting this far.
Let’s put what you’ve learned to the test.


Here’s a quadratic equation

2x^2 + 5x + 3

And here’s the quadratic formula.

Quadratic Formula

Your task:  Solve x by entering

Quadratic Solution

Your extra challenge:  Do it with Apple’s calculator. Do it in RPN mode.