<!--
{
  "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/negativeAbsolute(_:)-66a7a",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO16negativeAbsoluteySaySfGxAA0A6BufferRzSf7ElementRtzlFZ"
  },
  "title" : "negativeAbsolute(_:)"
}
-->

# negativeAbsolute(_:)

Returns the negative absolute value of each element in the supplied single-precision vector.

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

## Parameters

`vector`

The source vector.

## Discussion

For example, the following code calculates the negative absolute values of the elements of an array:

```swift
    let values: [Float] = [-1, 2, -3, 4, -5, 6, -7, 8]
    
    let negativeAbsoluteValues = vDSP.negativeAbsolute(values)
    
    // Prints "[-1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0]".
    print(negativeAbsoluteValues)
```

---

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)