---
title: "minimumMagnitude(_:_:)"
framework: swift
role: symbol
role_heading: Type Method
path: "swift/float80/minimummagnitude(_:_:)"
---

# minimumMagnitude(_:_:)

Returns the value with lesser magnitude.

## Declaration

```swift
static func minimumMagnitude(_ x: Self, _ y: Self) -> Self
```

## Parameters

- `x`: A floating-point value.
- `y`: Another floating-point value.

## Return Value

Return Value Whichever of x or y has lesser magnitude, or whichever is a number if the other is NaN.

## Discussion

Discussion This method returns the value with lesser magnitude of the two given values, preserving order and eliminating NaN when possible. For two values x and y, the result of minimumMagnitude(x, y) is x if x.magnitude <= y.magnitude, y if y.magnitude < x.magnitude, or whichever of x or y is a number if the other is a quiet NaN. If both x and y are NaN, or either x or y is a signaling NaN, the result is NaN. Double.minimumMagnitude(10.0, -25.0) // 10.0 Double.minimumMagnitude(10.0, .nan) // 10.0 Double.minimumMagnitude(.nan, -25.0) // -25.0 Double.minimumMagnitude(.nan, .nan) // nan The minimumMagnitude method implements the minNumMag operation defined by the IEEE 754 specification.
