Pure Programmer
Blue Matrix


Cluster Map

Project: Compute π

Write a program that computes and prints the value π which can be easily computed with standard math functions using one of the formula:

  • atan(1.0)*4.0
  • atan2(0.0, -1.0)
  • acos(-1.0)
  • 2.0*acos(0.0)

Which formula produces an answer closer to the standard math definition of π?

See [[Pi]]

Output
$ perl ComputePi1.pl "abs" is not exported by the Math::Trig module "atan2" is not exported by the Math::Trig module Can't continue after import errors at ComputePi1.pl line 9. BEGIN failed--compilation aborted at ComputePi1.pl line 9.

Solution