Function

vDSP_vfrac(_:_:_:_:_:)

Truncates the elements of a single-precision vector to fractions.

Declaration

func vDSP_vfrac(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

Parameters

__A

Single-precision real input vector

__IA

Stride for A

__C

Single-precision real output vector

__IC

Stride for C

__N

The number of elements to process

Discussion

Performs the following operation:

mathematical formula

The "function" truncate(x) is the integer farthest from 0 but not farther than x. Thus, for example, vDSP_vFrac(-3.25) produces the result -0.25.

Sets each element of vector C to the signed fractional part of the corresponding element of A.

See Also

Single-Vector Fractional Part Extraction

static func trunc<U>(U) -> [Double]

Returns a double-precision array containing each element in the supplied vector truncated to a fraction.

static func trunc<U>(U) -> [Float]

Returns a single-precision array containing each element in the supplied vector truncated to a fraction.

static func trunc<U, V>(U, result: inout V)

Calculates each element in the supplied double-precision vector truncated to a fraction.

static func trunc<U, V>(U, result: inout V)

Calculates each element in the supplied single-precision vector truncated to a fraction.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software