<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/single-precision-floating-point-to-integer-conversion",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Single-precision floating point to integer conversion"
}
-->

# Single-precision floating point to integer conversion

Perform element-wise single-precision floating-point to integer conversion.

## Topics

### Floating point to integer conversion

[`static func floatingPointToInteger<T, U>(T, integerType: U.Type, rounding: vDSP.RoundingMode) -> [U]`](/documentation/Accelerate/vDSP/floatingPointToInteger(_:integerType:rounding:)-9z84u)

Returns single-precision values converted to integer values.

[`enum RoundingMode`](/documentation/Accelerate/vDSP/RoundingMode)

Floating point to integer conversion rounding modes.

### Floating point to 8-bit integer conversion

The functions in this group convert the values in a vector from floating-point values to integer values of a given size.

[`static func convertElements<U, V>(of: U, to: inout V, rounding: vDSP.RoundingMode)`](/documentation/Accelerate/vDSP/convertElements(of:to:rounding:)-48635)

Converts single-precision values to 8-bit signed integers.

[`static func convertElements<U, V>(of: U, to: inout V, rounding: vDSP.RoundingMode)`](/documentation/Accelerate/vDSP/convertElements(of:to:rounding:)-9qu7f)

Converts single-precision values to 8-bit unsigned integers.

[`enum RoundingMode`](/documentation/Accelerate/vDSP/RoundingMode)

Floating point to integer conversion rounding modes.

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

Converts a vector of single-precision floating-point values to signed 8-bit integer values, and rounds towards zero.

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

Converts a vector of single-precision floating-point values to signed 8-bit integer values, and rounds towards the nearest integer.

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

Converts a vector of single-precision floating-point values to unsigned 8-bit integer values, and rounds towards zero.

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

Converts a vector of single-precision floating-point values to unsigned 8-bit integer values, and rounds towards the nearest integer.

### Floating point to 16-bit integer conversion

[`static func convertElements<U, V>(of: U, to: inout V, rounding: vDSP.RoundingMode)`](/documentation/Accelerate/vDSP/convertElements(of:to:rounding:)-slaa)

Converts single-precision values to 16-bit signed integers.

[`static func convertElements<U, V>(of: U, to: inout V, rounding: vDSP.RoundingMode)`](/documentation/Accelerate/vDSP/convertElements(of:to:rounding:)-3tofv)

Converts single-precision values to 16-bit unsigned integers.

[`enum RoundingMode`](/documentation/Accelerate/vDSP/RoundingMode)

Floating point to integer conversion rounding modes.

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

Converts a vector of single-precision floating-point values to signed 16-bit integer values, and rounds towards zero.

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

Converts a vector of single-precision floating-point values to signed 16-bit integer values, and rounds towards the nearest integer.

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

Converts a vector of single-precision floating-point values to unsigned 16-bit integer values, and rounds towards zero.

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

Converts a vector of single-precision floating-point values to unsigned 16-bit integer values, and rounds towards the nearest integer.

### Floating point to 24-bit integer conversion

The functions in this group scale and convert floating-point values to and from signed 24-bit integer values.

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

Converts a vector of single-precision floating-point values to signed 24-bit integer values, and rounds towards zero.

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

Converts a vector of single-precision floating-point values to signed 24-bit integer values, and rounds towards the nearest integer.

[`struct vDSP_int24`](/documentation/Accelerate/vDSP_int24)

A data structure that holds a 24-bit signed integer value.

[`struct vDSP_uint24`](/documentation/Accelerate/vDSP_uint24)

A data structure that holds a 24-bit unsigned integer value.

### Floating point to 32-bit integer conversion

[`static func convertElements<U, V>(of: U, to: inout V, rounding: vDSP.RoundingMode)`](/documentation/Accelerate/vDSP/convertElements(of:to:rounding:)-2dsry)

Converts single-precision values to 32-bit signed integers.

[`static func convertElements<U, V>(of: U, to: inout V, rounding: vDSP.RoundingMode)`](/documentation/Accelerate/vDSP/convertElements(of:to:rounding:)-14dc1)

Converts single-precision values to 32-bit unsigned integers.

[`enum RoundingMode`](/documentation/Accelerate/vDSP/RoundingMode)

Floating point to integer conversion rounding modes.

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

Converts a vector of single-precision floating-point values to signed 32-bit integer values, and rounds towards zero.

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

Converts a vector of single-precision floating-point values to signed 32-bit integer values, and rounds towards the nearest integer.

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

Converts a vector of single-precision floating-point values to unsigned 32-bit integer values, and rounds towards zero.

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

Converts a vector of single-precision floating-point values to unsigned 32-bit integer values, and rounds towards the nearest integer.



---

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)