Divides each element in an array by the corresponding value in a second array of double-precision values.
SDKs
- iOS 5.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Accelerate
Declaration
func vvdiv(_: Unsafe Mutable Pointer<Double>, _: Unsafe Pointer<Double>, _: Unsafe Pointer<Double>, _: Unsafe Pointer<Int32>)
Parameters
parameter 1
The output array, z.
parameter 2
The numerators input array, y.
parameter 3
The denominators input array, x.
parameter 4
The number of elements in the arrays.
Discussion
The following code shows an example of using vvdiv(_:
:
var x: [Double] = [1, 2, 2, 4]
var y: [Double] = [1, 1, 10, 30]
var z = [Double](repeating: 0, count: x.count)
var n = Int32(x.count)
vvdiv(&z, &y, &x, &n)
print(z) // [1.0, 0.5, 5.0, 7.5]