Why does Spotlight give a wrong value for `cos(pi/2)`?
It's due to the lack of precision of pi and due to the overall all lack of precision in the built-in system. 

pi = 3.1415926536

pi/2 = 1.5707963268 

cos(1.5707963268) = -5.103412e-12

FYI =  5.103412e-12 = 0.000000000005103412 ~ 0 




About the overall system precision : 

3.141592653589793238462643383 = 3.1415926536 


In Python we get following : 

&gt;&gt;&gt; float("3.141592653589793238462643383")
3.141592653589793


As we can see there is a problem with the precision since it doesn't even match the float representation.