If you ever need to run a quick calculation or two when working on your Mac, then you can do so using Apple’s Spotlight search; however, while you might find yourself using this for basic addition and multiplication, Spotlight’s calculations support far more, and if used properly can be just as if not more valuable than Apple’s included Calculator utility.
If you are unfamiliar with using Spotlight as a calculator, then you can access it quickly by pressing Command-Space to invoke Spotlight, followed by simply typing your equation, such as “1+4” which will show you a top hit of “5” next to an icon representing the calculator. At this point, you can press Enter to directly open the calculator (though it will be at 0 and not be passed the result of this calculation), or you can press Command-C on the highlighted result, to copy it to the clipboard.
Now you might be inclined to just use Spotlight for a quick addition or multiplication, but you can also use it for anything from trigonometric functions (sin, cos, tan, etc.), to calculating roots, rounding in various ways, among other useful features. To help with this, here is the list of supported functions you can use in Spotlight:
The basic operators in Spotlight’s calculator are the classic +, -, *, / symbols for addition, subtraction, multiplication, and division, but in addition you have the following ones available for more complex math:
% — The modulus symbol, used similarly to division, but will issue you the remainder in division, rather than the full ratio.
^ — The exponent, used between two numbers will raise one to the power of the other.
() — Parentheses, used for containing values and isolating orders of operation.
Spotlight has a couple of standard numerical constants defined, namely pi and e:
pi — the classic 3.1415…, or the complete distance of half of the unit circle
e — euler’s number, used for natural logarithms and exponents
The trigonometric functions, along with their arc and hyperbolic equivalents, are also available:
sin() — Standard sine
cos() — Standard cosine
tan() — Standard tangent
asin() — Standard arcsine
acos() — Standard arccosine
atan() — Standard arctangent
sinh() — Hyperbolic sine
cosh() — Hyperbolic cosine
tanh() — Hyperbolic tangent
asinh() — Hyperbolic arcsine
acosh() — Hyperbolic cosine
atanh() — Hyperbolic tangent
Note that the trigonometric functions are performed in classic Radian mode, so you must first convert degrees measurements to radians (i.e., multiplying by pi/180).
Exponents and Logarithms
You can always use the exponent operator “^” to get exponents; however, you can also use defined options:
exp() — This is the natural exponent, or equivalent of raising to the power of “e” (e^num)
E — This allows you to write “*10^number”, such as the following (10E4 for 10*10^4)
log() — This takes the base10 logarithm of the given number
ln() — This takes the natural logarithm of the number
For logarithms of other bases besides e and 10, you can use the basic math conversion of dividing the base10 logarithm by the base10 log of the new base, for instance to get the log2 of a number “x”, you can do the following in Spotlight: log(x)/log(2)
The square and cube roots are available as built-in functions; however, you can also use fractional exponents:
sqrt() — The standard square root of the given number
cbrt() — The cube root of the given number
For other roots besides the square and cube root, you can use exponents in the form X^Y, where you can take x^(1/4) to get the fourth root, or x^(1/5) to get the fifth root, etc.
Finally, you can use the following functions to round, truncate, and get the absolute value of numbers:
ceil() — Gives you the closest integer by rounding up
floor() — Gives you the closest integer by rounding down
rint() — Gives you the closest integer by standard rounding
fabs() — Gives you the absolute value of a number.
M+, M-, MR options in Spotlight
While the calculator has a M+, M- and MR options for storing values, you can do the same with Spotlight by pressing Command-C to copy the results of a calculation to the clipboard. From here, you can create new equations by pasting the results back into equations you are creating in Spotlight, and then again copying the results to the clipboard to save them.