# Math symbol help in C++

#### o0OBruceLeeO0o

##### Member
Heres the math I need to do. 10 to the power of "variable". How would I do that? Thanks

#### XWRed1

##### Senior Member
#include <math.h>

Then use the pow() function:
SYNOPSIS
#include <math.h>
double pow(double X, double Y);
float pow(float X, float Y);

DESCRIPTION
`pow' and `powf' calculate X raised to the exp1.0nt Y.

OP

#### o0OBruceLeeO0o

##### Member
Im getting errors with it so Im gonna make sure im using it right ... If x = 10 and y = 5 then pow would = 100000 right? Can I use pow as a normal variable? Or am I right in thinking its one of those special words that you cant use because its taken by a header or something (ie math.h) . Sorry I am new

#### Thelemac

It's a function...so it you would use it like so:

float x;
float y;
float z;

z=pow(x,y); // z = x^y

OP

#### o0OBruceLeeO0o

##### Member
ok thats what Im doing but its not giving me the right output! Guess i have an error elseware . Thanks for replies

edit: I had a + where I needed a * . Works great now

Last edited:

Replies
5
Views
367
Replies
3
Views
118
Replies
3
Views
141
Replies
59
Views
902
Replies
4
Views
124