The mathematical constant pi.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
static var pi: Double { get }
Discussion
This value should be rounded toward zero to keep user computations with angles from inadvertently ending up in the wrong quadrant. A type that conforms to the Floating
protocol provides the value for pi
at its best possible precision.
print(Double.pi)
// Prints "3.14159265358979"