---
title: pi
framework: swift
role: symbol
role_heading: Type Property
path: swift/double/pi
---

# pi

The mathematical constant pi (π), approximately equal to 3.14159.

## Declaration

```swift
static var pi: Double { get }
```

## Discussion

Discussion When measuring an angle in radians, π is equivalent to a half-turn. This value is rounded toward zero to keep user computations with angles from inadvertently ending up in the wrong quadrant. A type that conforms to the FloatingPoint protocol provides the value for pi at its best possible precision. print(Double.pi) // Prints "3.14159265358979"

## See Also

### Accessing Numeric Constants

- [infinity](swift/double/infinity.md)
- [greatestFiniteMagnitude](swift/double/greatestfinitemagnitude.md)
- [nan](swift/double/nan.md)
- [signalingNaN](swift/double/signalingnan.md)
- [ulpOfOne](swift/double/ulpofone.md)
- [leastNonzeroMagnitude](swift/double/leastnonzeromagnitude.md)
- [leastNormalMagnitude](swift/double/leastnormalmagnitude.md)
- [zero](swift/double/zero.md)
