Pure Programmer
Blue Matrix


Cluster Map

Project: Compute π Function

Write a function that computes and returns 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)

See [[Pi]]

Output
$ swiftc ComputePi3.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)

Solution