<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP_minmgvD",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vDSP_minmgvD"
  },
  "title" : "vDSP_minmgvD"
}
-->

# vDSP_minmgvD

Calculates the double-precision minimum magnitude of a vector.

```
extern void vDSP_minmgvD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length __N);
```

## Parameters

`__A`

The input vector, `A`.

`__IA`

The distance between the elements in the input vector.

`__C`

The output scalar value, `C`. If `N` is zero, the function sets `C` to `infinity`.

`__N`

The number of elements that the function processes.

## Discussion

This function calculates the minimum magnitude of the first `N` elements of input vector `A`, and writes the result to output scalar `C`.

![A diagram showing the operation of this function. There are three rows. The top row represents the input vector, A, with three boxes. The middle row represents the operation a box that contains the absolute-minimum function. The bottom row represents the output scalar value C as a  box. The diagram has connecting lines from the input vector to the operation, and from the operation to the output scalar value.](images/com.apple.accelerate/media-4465963@2x.png)

The following code shows an example of using this function:

```swift
    let stride = vDSP_Stride(1)

    let a: [Double] = [-1.5, 2.25, 3.6,
                      0.2, -0.1, -4.3]
    let n = vDSP_Length(a.count)

    var c = Double()

    vDSP_minmgvD(a,
                stride,
                &c,
                n)

    print("min magnitude", c) // Prints "min magnitude 0.1".
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)