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
$ swiftc ComputePi1.swift -I . -L . -lUtils
error: link command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lUtils
clang: error: linker command failed with exit code 1 (use -v to see invocation)