<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/absolute-and-negation-functions",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Absolute and negation functions"
}
-->

# Absolute and negation functions

Compute the absolute or negated value of each element in a vector.

## Topics

### Vector absolute functions

[`static func absolute<U>(U) -> [Float]`](/documentation/Accelerate/vDSP/absolute(_:)-5ehc1)

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

[`static func absolute<U>(U) -> [Double]`](/documentation/Accelerate/vDSP/absolute(_:)-9c3ge)

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

[`static func absolute<U, V>(U, result: inout V)`](/documentation/Accelerate/vDSP/absolute(_:result:)-4pigo)

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

[`static func absolute<U, V>(U, result: inout V)`](/documentation/Accelerate/vDSP/absolute(_:result:)-657bd)

Calculates the absolute value of each element in the supplied double-precision vector.

[`extern void vDSP_vabsi(const int *__A, vDSP_Stride __IA, int *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_vabsi)

Calculates the absolute value of each element in the supplied integer vector using the specified stride.

[`extern void vDSP_vabs(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_vabs)

Calculates the absolute value of each element in the supplied single-precision vector using the specified stride.

[`extern void vDSP_vabsD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_vabsD)

Calculates the absolute value of each element in the supplied double-precision vector using the specified stride.

### Complex vector absolute functions

[`static func absolute<V>(DSPSplitComplex, result: inout V)`](/documentation/Accelerate/vDSP/absolute(_:result:)-9x5jn)

Calculates the absolute value of each element in the supplied single-precision complex vector.

[`static func absolute<V>(DSPDoubleSplitComplex, result: inout V)`](/documentation/Accelerate/vDSP/absolute(_:result:)-1wu9x)

Calculates the absolute value of each element in the supplied double-precision complex vector.

[`extern void vDSP_zvabs(const DSPSplitComplex *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_zvabs)

Calculates the absolute value of each element in the supplied single-precision complex vector using the specified stride.

[`extern void vDSP_zvabsD(const DSPDoubleSplitComplex *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_zvabsD)

Calculates the absolute value of each element in the supplied double-precision complex vector using the specified stride.

### Vector negative absolute functions

[`static func negativeAbsolute<U>(U) -> [Float]`](/documentation/Accelerate/vDSP/negativeAbsolute(_:)-66a7a)

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

[`static func negativeAbsolute<U>(U) -> [Double]`](/documentation/Accelerate/vDSP/negativeAbsolute(_:)-1b5m6)

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

[`static func negativeAbsolute<U, V>(U, result: inout V)`](/documentation/Accelerate/vDSP/negativeAbsolute(_:result:)-85gj0)

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

[`static func negativeAbsolute<U, V>(U, result: inout V)`](/documentation/Accelerate/vDSP/negativeAbsolute(_:result:)-1gpcy)

Calculates the negative absolute value of each element in the supplied double-precision vector.

[`extern void vDSP_vnabs(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_vnabs)

Calculates the negative absolute value of each element in the supplied single-precision vector using the specified stride.

[`extern void vDSP_vnabsD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_vnabsD)

Calculates the negative absolute value of each element in the supplied double-precision vector using the specified stride.

### Vector negation functions

[`static func negative<U>(U) -> [Float]`](/documentation/Accelerate/vDSP/negative(_:)-8mo1p)

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

[`static func negative<U>(U) -> [Double]`](/documentation/Accelerate/vDSP/negative(_:)-24oe4)

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

[`static func negative<U, V>(U, result: inout V)`](/documentation/Accelerate/vDSP/negative(_:result:)-92caw)

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

[`static func negative<U, V>(U, result: inout V)`](/documentation/Accelerate/vDSP/negative(_:result:)-5bwqv)

Calculates the negative value of each element in the supplied double-precision vector.

[`extern void vDSP_vneg(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_vneg)

Calculates the negative value of each element in the supplied single-precision vector using the specified stride.

[`extern void vDSP_vnegD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_vnegD)

Calculates the negative value of each element in the supplied double-precision vector using specified stride.

### Complex vector negation functions

[`extern void vDSP_zvneg(const DSPSplitComplex *__A, vDSP_Stride __IA, const DSPSplitComplex *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_zvneg)

Calculates the negative value of each element in the supplied complex single-precision vector.

[`extern void vDSP_zvnegD(const DSPDoubleSplitComplex *__A, vDSP_Stride __IA, const DSPDoubleSplitComplex *__C, vDSP_Stride __IC, vDSP_Length __N);`](/documentation/Accelerate/vDSP_zvnegD)

Calculates the negative value of each element in the supplied complex double-precision vector.



---

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)