<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP/mean(_:)-1lwak",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO4meanySfxAA0A6BufferRzSf7ElementRtzlFZ"
  },
  "title" : "mean(_:)"
}
-->

# mean(_:)

Returns the mean value of a single-precision vector.

```
static func mean<U>(_ vector: U) -> Float where U : AccelerateBuffer, U.Element == Float
```

## Parameters

`vector`

The source vector.

## Discussion

This function calculates and returns the mean value of a supplied vector.

The following is an example of using [`mean(_:)`](/documentation/Accelerate/vDSP/mean(_:)-1lwak):

```swift
    let a: [Float] = [-8, -4, -2, 0, 2, 4, 8]

    let mean = vDSP.mean(a)
    
    print(mean) // Prints "0.0".
```

---

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)