powering

hello I need help
I'm trying to do simple calc but I'm faling with all my tryings:

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float firstnum, secondnum, result;
char sign;
while(true)
{
cout << "first number:\n";
cin >> firstnum;
cout << "What do yo want to do: * / + - ^\n";
cin >> sign;
cout << "second number:\n";
cin >> secondnum;
if(sign == '*')
{
cout << "the result is:" << firstnum * secondnum << "\n\n";
}
if(sign == '+')
{
cout << "the result is:" << firstnum + secondnum << "\n\n";
}
if(sign == '-')
{
cout << "the result is:" << firstnum - secondnum << "\n\n";
}
if(sign == '/')
{
if(secondnum == 0)
{
cout << "invalid denominator" << "\n\n";
}
else
{
cout << "the result is:" << firstnum / secondnum << "\n\n";
}
}
if(sign == '^')
{
result == pow((float) firstnum, secondnum);
cout << result << "\n\n";
}
}
return 0;
}

this is my code (C++code blocks compiler)
and this is the error:
undefined reference to `pow(double, double)'

HELP!!! Thank you!
if you see this in some others topics just ignore it!
it was my fault but I'm new, sorry!
Last edited on
Did you even read the response to one of your other posts?

Line 41: You're using the comparison operator (==), not the assignment operator (=).

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Topic archived. No new replies allowed.