# Type Conversion

No overview available.

## Topics

### Single-Vector Integer to Floating Point Conversion

`static func integerToFloatingPoint<T, U>(T, floatingPointType: U.Type) -> [U]`

Returns a vector of signed 8-bit integers converted to floating-point values.

`static func integerToFloatingPoint<T, U>(T, floatingPointType: U.Type) -> [U]`

Returns a vector of signed 16-bit integers converted to floating-point values.

`static func integerToFloatingPoint<T, U>(T, floatingPointType: U.Type) -> [U]`

Returns a vector of signed 32-bit integers converted to floating-point values.

`static func integerToFloatingPoint<T, U>(T, floatingPointType: U.Type) -> [U]`

Returns a vector of unsigned 8-bit integers converted to floating-point values.

`static func integerToFloatingPoint<T, U>(T, floatingPointType: U.Type) -> [U]`

Returns a vector of unsigned 16-bit integers converted to floating-point values.

`static func integerToFloatingPoint<T, U>(T, floatingPointType: U.Type) -> [U]`

Returns a vector of unsigned 32-bit integers converted floating-point values.

### Single-Vector Precision Conversion

The functions in this group convert between single-precision and double-precision floating-point vectors.

`static func floatToDouble<U>(U) -> [Double]`

Returns single-precision values converted to double-precision values.

`static func doubleToFloat<U>(U) -> [Float]`

Returns double-precision values converted to single-precision values.

`static func convertElements<U, V>(of: U, to: inout V)`

Converts double-precision values to single-precision values.

`static func convertElements<U, V>(of: U, to: inout V)`

Converts single-precision values to double-precision values.

### Single-Vector 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.

`func vDSP_vfix8(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Int8>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to signed 8-bit integer values, rounding towards zero.

`func vDSP_vfix8D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Int8>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to signed 8-bit integer values, rounding towards zero.

`func vDSP_vfixr8(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Int8>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to signed 8-bit integer values, rounding towards nearest integer.

`func vDSP_vfixr8D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Int8>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to signed 8-bit integer values, rounding towards nearest integer.

`func vDSP_vfixu8(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<UInt8>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to unsigned 8-bit integer values, rounding towards zero.

`func vDSP_vfixu8D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<UInt8>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to unsigned 8-bit integer values, rounding towards zero.

`func vDSP_vfixru8(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<UInt8>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to unsigned 8-bit integer values, rounding towards nearest integer.

`func vDSP_vfixru8D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<UInt8>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to unsigned 8-bit integer values, rounding towards nearest integer.

### Single-Vector Floating Point to 16-Bit Integer Conversion

`func vDSP_vfix16(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Int16>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to signed 16-bit integer values, rounding towards zero.

`func vDSP_vfix16D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Int16>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to signed 16-bit integer values, rounding towards zero.

`func vDSP_vfixr16(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Int16>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to signed 16-bit integer values, rounding towards nearest integer.

`func vDSP_vfixr16D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Int16>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to signed 16-bit integer values, rounding towards nearest integer.

`func vDSP_vfixu16(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<UInt16>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to unsigned 16-bit integer values, rounding towards zero.

`func vDSP_vfixu16D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<UInt16>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to unsigned 16-bit integer values, rounding towards zero.

`func vDSP_vfixru16(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<UInt16>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to unsigned 16-bit integer values, rounding towards nearest integer.

`func vDSP_vfixru16D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<UInt16>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to unsigned 16-bit integer values, rounding towards nearest integer.

### Single-Vector Floating Point to 32-Bit Integer Conversion

`func vDSP_vfix32(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Int32>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to signed 32-bit integer values, rounding towards zero.

`func vDSP_vfix32D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Int32>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to signed 16-bit integer values, rounding towards zero.

`func vDSP_vfixr32(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Int32>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to signed 32-bit integer values, rounding towards nearest integer.

`func vDSP_vfixr32D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Int32>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to signed 32-bit integer values, rounding towards nearest integer.

`func vDSP_vfixu32(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<UInt32>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to unsigned 32-bit integer values, rounding towards zero.

`func vDSP_vfixu32D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<UInt32>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to unsigned 32-bit integer values, rounding towards zero.

`func vDSP_vfixru32(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<UInt32>, vDSP_Stride, vDSP_Length)`

Converts an array of single-precision floating-point values to unsigned 32-bit integer values, rounding towards nearest integer.

`func vDSP_vfixru32D(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<UInt32>, vDSP_Stride, vDSP_Length)`

Converts an array of double-precision floating-point values to unsigned 32-bit integer values, rounding towards nearest integer.

### Single-Vector 8-Bit Integer to Floating Point Conversion

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`func vDSP_vflt8(UnsafePointer<Int8>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Stride, vDSP_Length)`

Converts an array of signed 8-bit integers to single-precision floating-point values.

`func vDSP_vflt8D(UnsafePointer<Int8>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Stride, vDSP_Length)`

Converts an array of signed 8-bit integers to double-precision floating-point values.

`func vDSP_vfltu8(UnsafePointer<UInt8>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Stride, vDSP_Length)`

Converts an array of unsigned 8-bit integers to single-precision floating-point values.

`func vDSP_vfltu8D(UnsafePointer<UInt8>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Stride, vDSP_Length)`

Converts an array of unsigned 8-bit integers to double-precision floating-point values.

### Single-Vector 16-Bit Integer to Floating Point Conversion

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`func vDSP_vflt16(UnsafePointer<Int16>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Stride, vDSP_Length)`

Converts an array of signed 16-bit integers to single-precision floating-point values.

`func vDSP_vflt16D(UnsafePointer<Int16>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Stride, vDSP_Length)`

Converts an array of signed 16-bit integers to double-precision floating-point values.

`func vDSP_vfltu16(UnsafePointer<UInt16>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Stride, vDSP_Length)`

Converts an array of unsigned 16-bit integers to single-precision floating-point values.

`func vDSP_vfltu16D(UnsafePointer<UInt16>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Stride, vDSP_Length)`

Converts an array of unsigned 16-bit integers to double-precision floating-point values.

### Single-Vector 32-Bit Integer to Floating Point Conversion

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`static func convertElements<U, V>(of: U, to: inout V)`

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

`func vDSP_vflt32(UnsafePointer<Int32>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Stride, vDSP_Length)`

Converts an array of signed 32-bit integers to single-precision floating-point values.

`func vDSP_vflt32D(UnsafePointer<Int32>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Stride, vDSP_Length)`

Converts an array of signed 32-bit integers to double-precision floating-point values.

`func vDSP_vfltu32(UnsafePointer<UInt32>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Stride, vDSP_Length)`

Converts an array of unsigned 32-bit integers to single-precision floating-point values.

`func vDSP_vfltu32D(UnsafePointer<UInt32>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Stride, vDSP_Length)`

Converts an array of unsigned 32-bit integers to double-precision floating-point values.

### 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.

`struct vDSP_uint24`

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

`struct vDSP_int24`

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

### Enumerations

`enum vDSP.RoundingMode`

Floating point to integer conversion rounding modes.