I have a problem with an SQL query and i’ve narrowed it down to the following code
SELECT ACOS( (SIN(PI()* 52.9519918465976/180)*SIN(PI()* 52.9519918465976/180))+(COS(PI()* 52.9519918465976/180)*cos(PI()* 52.9519918465976/180)*COS(PI()* -1.14304013581239/180-PI()* -1.14304013581239/180))) AS test
I get the following error message ‘An invalid floating point operation occurred’
Can abody see what the issue is?
Thanks in advance
Your result in
ACOS()is bigger than1which can’t be.That is because of floating point inaccuracy. it could be
1.00000001for instance. Putting it just a little below1works like this: