Function

vvpowf

Raises each element in an array to the power of the corresponding element in a second array of single-precision values.

Declaration

void vvpowf(float *, const float *, const float *, const int *);

Parameters

parameter 1

The output array, z.

parameter 2

The exponent input array, y.

parameter 3

The base input array, x.

parameter 4

The number of elements in the arrays.

Discussion

The following code shows an example of using vvpowf:

float x[] = {3, 2, 10, 6};
float y[] = {2, 4, 3, 2};
float z[4];
int n = 4;
 
vvpowf(z, y, x, &n);
 
NSLog(@"z: [%lf, %lf, %lf, %lf]", z[0], z[1], z[2], z[3]);

The following special values of x and y produce the given value of z:

x (base)

y (exponent)

z (result)

odd integer, <0

+/-0

+/-inf

odd integer, >0

+/-0

+/-0

otherwise, <0

+/-0

+inf

otherwise, >0

+/-0

+0

+/-inf

-1

1

NaN

+1

1

+/-0

NaN

1

-inf

|x|<1

+inf

-inf

|x|>1

+0

+inf

|x|<1

+0

+inf

|x|>1

+inf

odd integer, <0

-inf

-0

odd integer, >0

-inf

-inf

otherwise, <0

-inf

+0

otherwise, >0

-inf

+inf

<0

+inf

+0

>0

+inf

+inf

non-integer

<0

NaN

See Also

Array-Oriented Power Functions

vvpow

Raises each element in an array to the power of the corresponding element in a second array of double-precision values.

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