Why is it considered good coding practice to define PI as a constant, rather than just using the value 3.141592 in my code?
Description
Why is it considered good coding practice to define PI as a constant, rather than just using the value 3.141592 in my code?
It simplifies the maintenance of your program, in case the value of PI
ever needs to be changed. Also it will make your program more portable
to other compilers that use different values of PI.