---
title: magnitude
framework: swift
role: symbol
role_heading: Instance Property
path: swift/uint8/magnitude-swift.property
---

# magnitude

The magnitude of this value.

## Declaration

```swift
var magnitude: Self { get }
```

## Discussion

Discussion Every unsigned integer is its own magnitude, so for any value x, x == x.magnitude. The global abs(_:) function provides more familiar syntax when you need to find an absolute value. In addition, because abs(_:) always returns a value of the same type, even in a generic context, using the function instead of the magnitude property is encouraged.
