Why C# Math.Sin() returns different values from C++ sin()?

Viewed 302

During the conversion of C++ code to C# we noticed that the results of C++ sin() function are different from C# Math.Sin().

Why? What's the reason behind this?

Is it possible to implement a C# sine method that returns exactly the same values?

More details here.

EDIT: These are some angles which show incorrect results passing C++ std::nextafter() values to C# Math.Sin():

1. Angle: 0.19634954084936207
C++ : 0.19509032201612825
C#  : 0.19509032201612828

2. Angle: 0.58904862254808621
C++ : 0.55557023301960218
C#  : 0.55557023301960229

3. Angle: 1.1780972450961724
C++ : 0.92387953251128674
C#  : 0.92387953251128663

4. Angle: 1.7671458676442586  
C++ : 0.98078528040323043
C#  : 0.98078528040323054
0 Answers
Related