pow() pow() pow()
~
^_^ admitedly it's a bit annnoying but I'm not sure if you can overload bitwise operators, but you could try to see.
[php]
//note the syntax of opertaor overload is remenisant of any functions syntax
// <type> <name>(<operands>) int main(void) operator ^(&F, &S)
// we need the memory addresses for this to work like an actual operator
//which require the = sign
operator ^(<type> &F, <type> &S)
{
//code to work with operands F,S
}
operator ^(double, double);
operator ^(int, int);
int main()
{
int n;
n = 5^6;
....
......
}
[/php]
I considered the idea of writing it out for you, but operator overloading is something you should go learn about if you don't already know. I guess copying from code from the actual pow() function in the header would help. Operator overloading would also allow you to make a "better" version of
pow() since it only provides support for int values. Considering powers with double values would cause(many) inaccuracies it might be necessary that you have it truncate float values.
Also for versatility you might having to run into the OOP idea of templates.