Hey guys, as I progress through my C++ education ive started getting into headers and drivers, so I figured for good practice I would make my own header file that contains function prototypes and a implementation file for testing.
I want to make my own version of pow, so ive made a functions called:
double power(double x, double y);
Now we all know how a power works, its multiplies number x by itself y number of times but im unsure of how to implement this. I figured a for loop would work.
for (int i = 0; i < y; i++)
{
// something to do with x*x?
}
But from here I get stuck, any ideas?
I want to make my own version of pow, so ive made a functions called:
double power(double x, double y);
Now we all know how a power works, its multiplies number x by itself y number of times but im unsure of how to implement this. I figured a for loop would work.
for (int i = 0; i < y; i++)
{
// something to do with x*x?
}
But from here I get stuck, any ideas?
Comment