sin, cos, tan and rounding error

前端 未结 9 658
执念已碎
执念已碎 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:27

    The answer is only 0 for sin(pi) - did you include all the digits of Pi ?

    -Has anyone else noticed a distinct lack of, irony/sense of humour around here?

提交回复
热议问题