AnsweredAssumed Answered

pow-Example in VDSP-Help is irritating

Question asked by StefanW on Feb 12, 2015
Latest reply on Mar 27, 2015 by StuartS

Hello,

 

First, the help text:

#include <math.h>

float powf (float x, float y);

double pow (double x, double y);

long double powd (long double x, long double y);

Description

The power functions compute the value of the first argument raised to the power of the second argument.

Error Conditions

A domain error occurs if the first argument is negative and the second argument cannot be represented as an integer. If the first argument is zero, the second argument is less than or equal to zero and the result cannot be represented, zero is returned.

Example

#include <math.h>

double z;

float x;

z = pow (5.0, 2.0); /* z = 16.0 */

x = powf (5.0, 2.0); /* x = 16.0 */

 

Neither 5 to the power of 2 is 16, nor 2 to the power of 5 is 16.

 

As it can be seen when running some test code, pow(5.0, 2.0) returns 25.0. So the Description is right, only the example is wrong.

I suggest that you fix that in the next update...

 

Kind Regards,

Stefan

Outcomes