**Video Transcript**

Hi, this is Gary with MacMost.com. In this episode let's look at how you can do advanced math calculations with Spotlight.

Now you probably already know about it and you may use it all the time Spotlight's ability to do simple math. So I'm going to bring up Spotlight. I'm not going to use this. I'm going to use Command Space because you want to do this as quickly and simply as possible. Command Space is the best way to get to Spotlight.

You can do simple math here. So 1+2 and it gives you the result. You probably also know that you can do, of course, subtraction. You can do multiplication. I'm using the asterisk key which is above the number 8. You can do division and you can get the answer.

But there is actually a lot more that you can do. You can do most of what's available in most calculators. As a matter of fact maybe you can do a little bit more if you just know the right functions to use.

So the first function I'm going to show is the square root. Suppose you wanted to find the square root of a number you can use the function sqrt and then you put in parentheses what you want to find the square root of. So 9 gives you 3; 10 gives you 3.16, etc.

There is also a cube root function cbrt. Likewise you can find the power by simply using the karat symbol which is Shift 6 on most keyboards. So, for instance, 2^3 or 2^4. You can do roots with this as well. So if I wanted to 9^ and then I wanted to find the square root of it I can do by (.5) or by (½) and get the correct answer. A cube root of say 27^ I can do one divided by 3 so you can go to even deeper roots if you wanted to as well.

There are functions that deal with rounding. So normally you wouldn't need help rounding but say if you were doing something like the square root of 15 but you wanted it to be rounded to the nearest integer you could put a function around that. So you can nest functions.

You can do ceil for ceiling and it rounds it up to four. Or you could floor and it will round it down. Likewise rint, round integer, will round something up or down. So 7.2 rounds down to 7, 7.8 rounds up to eight.

You also have absolute value function, fabs. So 9 is 9 and negative 9 is also 9.

You've got a pretty full set of trigonometry functions as well. So you have sine. You've got cosine. You've got tangent. You can also do arcsine and acosine and arctangent as well. Even hyperbolic sines. Just add an h to sine, cosine, or tangent and you can do arc hyperbolic sines, cosines, and tangents as well.

You've got some exponential functions and logarithms. So exp is the natural exponent. You can use log to get a base ten logarithm and ln for natural logarithm.

You can also write numbers with an e. So for instance, 60E6 adds with six zeros.

There is also at least two constants that Spotlight knows. There is pi, just the two letters p and i. Then e, it knows that as well.

There are a few symbols that you can use. For instance you can use an exclamation point for a factorial. So, for instance,

5!120, 6!720, etc. You have modulus using the percent symbol. So, for instance, if you want to do 9%2 or 9%4 or 9%5, 19%5 you can do that as well.

You can use parentheses as much as you want. So, for instance, you can do 5+(7+8)*4 to better define exactly what it is that you mean when doing a more complex formula.

But there is still more. You can use percent as a percent not just modulus. So, for instance, 4%2 you can do that. But if would use it like this; say you were calculating say on a $50 bill what is 7 percent for tax. 50*7% for tax. In that case it understands that you mean percent not mod.

Also for the trigometric functions you are using, of course, radiants for those as you do with most computers. But you can actually use degrees as well because there are these other functions where you can do sine with degrees, sind(45), and it understands that with that d there it means degrees.

One last thing that I think is really cool is you don't have to use the multiplication symbol all the time. You can write things out like you may actually write then out in math class or if you use math a lot for work like I do. For instance, you can do this 5(8+1). No multiplication sign right there because it's implied. You can do the same thing with functions. 2sin(.5) and the multiplication there is implied. (8+1)(2+7) just like that.

Now you probably already know about it and you may use it all the time Spotlight's ability to do simple math. So I'm going to bring up Spotlight. I'm not going to use this. I'm going to use Command Space because you want to do this as quickly and simply as possible. Command Space is the best way to get to Spotlight.

You can do simple math here. So 1+2 and it gives you the result. You probably also know that you can do, of course, subtraction. You can do multiplication. I'm using the asterisk key which is above the number 8. You can do division and you can get the answer.

But there is actually a lot more that you can do. You can do most of what's available in most calculators. As a matter of fact maybe you can do a little bit more if you just know the right functions to use.

So the first function I'm going to show is the square root. Suppose you wanted to find the square root of a number you can use the function sqrt and then you put in parentheses what you want to find the square root of. So 9 gives you 3; 10 gives you 3.16, etc.

There is also a cube root function cbrt. Likewise you can find the power by simply using the karat symbol which is Shift 6 on most keyboards. So, for instance, 2^3 or 2^4. You can do roots with this as well. So if I wanted to 9^ and then I wanted to find the square root of it I can do by (.5) or by (½) and get the correct answer. A cube root of say 27^ I can do one divided by 3 so you can go to even deeper roots if you wanted to as well.

There are functions that deal with rounding. So normally you wouldn't need help rounding but say if you were doing something like the square root of 15 but you wanted it to be rounded to the nearest integer you could put a function around that. So you can nest functions.

You can do ceil for ceiling and it rounds it up to four. Or you could floor and it will round it down. Likewise rint, round integer, will round something up or down. So 7.2 rounds down to 7, 7.8 rounds up to eight.

You also have absolute value function, fabs. So 9 is 9 and negative 9 is also 9.

You've got a pretty full set of trigonometry functions as well. So you have sine. You've got cosine. You've got tangent. You can also do arcsine and acosine and arctangent as well. Even hyperbolic sines. Just add an h to sine, cosine, or tangent and you can do arc hyperbolic sines, cosines, and tangents as well.

You've got some exponential functions and logarithms. So exp is the natural exponent. You can use log to get a base ten logarithm and ln for natural logarithm.

You can also write numbers with an e. So for instance, 60E6 adds with six zeros.

There is also at least two constants that Spotlight knows. There is pi, just the two letters p and i. Then e, it knows that as well.

There are a few symbols that you can use. For instance you can use an exclamation point for a factorial. So, for instance,

5!120, 6!720, etc. You have modulus using the percent symbol. So, for instance, if you want to do 9%2 or 9%4 or 9%5, 19%5 you can do that as well.

You can use parentheses as much as you want. So, for instance, you can do 5+(7+8)*4 to better define exactly what it is that you mean when doing a more complex formula.

But there is still more. You can use percent as a percent not just modulus. So, for instance, 4%2 you can do that. But if would use it like this; say you were calculating say on a $50 bill what is 7 percent for tax. 50*7% for tax. In that case it understands that you mean percent not mod.

Also for the trigometric functions you are using, of course, radiants for those as you do with most computers. But you can actually use degrees as well because there are these other functions where you can do sine with degrees, sind(45), and it understands that with that d there it means degrees.

One last thing that I think is really cool is you don't have to use the multiplication symbol all the time. You can write things out like you may actually write then out in math class or if you use math a lot for work like I do. For instance, you can do this 5(8+1). No multiplication sign right there because it's implied. You can do the same thing with functions. 2sin(.5) and the multiplication there is implied. (8+1)(2+7) just like that.

Thanks.

This is great. Wish I had know about this capability previously, would have saved me a lot of time.

Thanks! I just forwarded your video to all my students.

Great, I had no idea Spotlight could do this. Thanks!

A GREAT function that has been secret too long. Will pass it on to all my geeky friends smart enough to own a Mac!