Math constant PI value in C

后端 未结 6 1261
清酒与你
清酒与你 2020-12-01 01:31

Calculating PI value is one of the complex problem and wikipedia talks about the approximations done for it and says it\'s difficult to calculate PI accurately.

How

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 01:54

    anyway you have not a unlimited accuracy so C define a constant in this way:

    #define PI 3.14159265358979323846
    

    import math.h to use this

提交回复
热议问题