---
title: vDSP_maxmgv
framework: Accelerate
role: symbol
role_heading: Function
platforms: [iOS 4.0+, iPadOS 4.0+, Mac Catalyst 13.1+, macOS 10.4+, visionOS 1.0+, watchOS 2.0+]
path: accelerate/vdsp_maxmgv
---

# vDSP_maxmgv

Calculates the single-precision maximum magnitude of a vector.

## Declaration

```occ
extern void vDSP_maxmgv(const float *__A, vDSP_Stride __IA, float *__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 0.
- `__N`: The number of elements that the function processes.

## Discussion

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

The following code shows an example of using this function:

## See Also

### Calculating the maximum value of a vector

- [vDSP_maxv](accelerate/vdsp_maxv.md)
- [vDSP_maxvD](accelerate/vdsp_maxvd.md)
- [vDSP_maxmgvD](accelerate/vdsp_maxmgvd.md)
