This symbol does not do what you think "^" it is a bit wise operator.
Look up the function pow or power from the math library. pow - C++ Reference

Tim S.