• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Math symbol help in C++

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.
#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.
 
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 :)
 
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

:)
 
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 * :eek: . Works great now :)
 
Last edited:
Back