sin, cos, tan and rounding error

前端 未结 9 637
执念已碎
执念已碎 2020-12-06 14:09

I\'m doing some trigonometry calculations in C/C++ and am running into problems with rounding errors. For example, on my Linux system:

#include 

        
9条回答
  •  天命终不由人
    2020-12-06 14:30

    Maybe too low accuracy of implementation

    M_PI = 3.14159265358979323846 (20 digits)
    

    http://fresh2refresh.com/c/c-function/c-math-h-library-functions/

提交回复
热议问题