UsingMac.com

Mac Tricks and Tips, Wallpapers and Applications for Mac Users

Leopard Spotlight - Calculator Functions

Advertisements

Besides doing logical expression, Leopard Spotlight can also do some mathematical calculations. Are you curious what are those functions?

I know a little bit about Java Programming Language, so I try to use the Math library, which contains some functions to do scientific calculations, on Spotlight. To my surprise, some of these functions work.

Here are some examples :

Trigonometry

  • sin(0.5) = 0.479
    sinus of 0.5, result in radian.
  • cos(0.5) = 0.878
    cosinus of 0.5, result in radian.
  • tan(0.25) = 0.255
    tangent of 0.25, result in radian.
  • asin(1) = 1.57
    arc sinus of 1 radian.
  • acos(1) = 0
    arc cosinus of 1 radian.
  • atan(1) = 0.785
    arc tangent of 1 radian.

Approximation

  • ceil(0.48) = 1
    Rounded to nearest smaller integer value.
  • rint(0.51) = 1
    Rounded to nearest integer value.

Exponential and Logarithm

  • exp(2) = 7.389
    Euler's number e to the power of 2.
  • pow(5,2) = 25
    5 to the power of 2.
  • sqrt(36) = 6
    Square-root of 36.
  • cbrt(216) = 6
    Cube-root of 216.
  • log(1e3) = 3
    Logarithmic base 10 of 1*10^3.

Categories: Leopard, Spotlight
Tags: Spotlight

Subscribe to RSS Leave a Comment (14)

Related Entries

Some articles taken from our resource base, tightly related to current article, to empower you with more knowledge on tweaking the most out of your Mac.

14 Comments

Himavanth B

well i don't no that it can even calculate Trigonometry and others
thanks

Peter

heh great stuff..

christian

Of what kind is the relation between Spotlight and the Java Math library?

Juan de Dios Santander Vela

In fact, Spotlight is written in Objective-C, and uses math.h functions. Java took some of those functions for the java.math package.

I've written a exhaustive exploration of math.h functions available through Spotlight's calculator in Spanish, but the functions summary is easily understandable.

http://www.entremaqueros.com/bitacoras/memoria/?p=946

Ben Perry

The following functions also work :
1. fmod(a,b) - remainder of 'a' / 'b'
2. fabs(a) - absolute value of 'a'
3. hypot(a,b) - hypotenuse of triangle with sides 'a' and 'b'
4. j0(a) - zeroth Bessel function of the first kind evaluated at 'a'
5. j1(a) - first Bessel function of the first kind evaluated at 'a'
6. y0(a) - zeroth Bessel function of the second kind evaluated at 'a'
7. y1(a) - first Bessel function of the second kind evaluated at 'a'
8. erf(a) - values of the error function evaluated at 'a'
9. erfc(a) - value of the complementary error function evaluated at 'a'
X. lgamma(a) - value of the logarithm of the gamma function evaluated at 'a'

The first 3 are the most useful for basic math - the rest I have no idea what they're for. Why some of the functions in math.h work and other don't is beyond me. It's not like they're any harder to calculate.

Ben

The Blueprint Project Black Edition

Nice post. Thanks for the info ..

Cheap Zentai

Nice post. Thanks for the info ..

Genius

The first 3 are the most useful for basic math - the rest I have no idea what they're for. Why some of the functions in math.h work and other don't is beyond me. It's not like they're any harder to calculate. Forex Robots

Poko

Ce qui est plus surprenant, vos œuvres texte, et apporte de bonnes relations publiques. Honneur et respect! Hypertension symptoms  Plus un homme le sait, le plus de possibilités qu'il a à faire correctement. Cela s'applique à n'importe quel problème. Par conséquent, essayez de lire, d'apprendre et de voir autant que possible. Surtout parce qu'elle permet un accès facile à Internet . . . Beauty salon

Polk

Ce qui est plus surprenant, Как раскрутить сайт vos œuvres texte, et apporte de bonnes relations publiques. Honneur et respect! Très belle après une longue recherche web asemirnoy, trouver, enfin, exactement ce dont vous avez besoin. Merci! как начать бизнес

wadsen led

thanks for it admin ?likle this website 

gagner argent internet

gagner argent internet

Nike

I am happy when reading your blog with updated information! thanks alot and hope that you will post more site that are related to this site.

Nike

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own blog now.

Leave a Comment