i am beginner in program to explain area of circle constant pi value in python.
Area of circle using constant PI value
Collapse
X
-
You can use float constant or #define constant to declare PI value.
1. float constant
Area of Circle in C
2. #define Constant
Area of Circle using #define -
Thank you bharani10. That is a nice start.
I am only adding to the math part.
If you want Pi to be more accurate, and if you have learned from the previous post, then you might try including (as you decide) some of this:
From https://en.wikipedia.org/wiki/Pi
Fractions: Approximate fractions include (in order of increasing accuracy)
22/7,
333/106,
355/113,
52163/16604,
103993/33102,
104348/33215, and
245850922/78256779 .
Please read the linked page from Wikipedia. It explains a lot more of the math.
.Comment
Comment