A type that can represent the absolute value of any possible value of this type.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
A type that can represent the absolute value of any possible value of this type.
SDK
Framework
var magnitude: UInt
The magnitude of this value.
func abs<T>(T) -> T
Returns the absolute value of the given number.
func signum() -> Int
Returns -1
if this value is negative and 1
if it’s positive; otherwise, 0
.