Math constant PI value in C

后端 未结 6 1272
清酒与你
清酒与你 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:35

    Depending on the library you are using the standard GNU C Predefined Mathematical Constants are here... https://www.gnu.org/software/libc/manual/html_node/Mathematical-Constants.html

    You already have them so why redefine them? Your system desktop calculators probably have them and are even more accurate so you could but just be sure you're not conflicting with existing defined ones to save on compile warnings as they tend to get defaults for things like that. Enjoy!

提交回复
热议问题