Hello,

I have a problem with the atan2 function.

I have 2 programs, one in C and one in Matlab. Both have an identical implementation.

My problem is that I am getting occasionally different values from the atan2 function in C and Matlab.

For instance:

x=0.29695007709080329

y= -0.96764419257510348

Matlab atan2= 2.8438364863237604

C atan2= 2.8438364863237608

So only the last digit is different (and not in all cases), but unfortunately, I would need the values to be identical.

Do you have any ideas it might be like this and how can I solve it?

Thank you.