Quote Originally Posted by MK27 View Post
Code:
int_power = (int)power;
This is equivalent:

Code:
if ( 0 == (int)power)
Interesting that you observe "because power is declared double , and it is not wise to use a double variable in an if statement" then less than ten lines later:

Code:
if ( power == -1)
It is not *necessarily* bad to use a double in an if; more specifically, it is bad to use == to compare a double or a float to an integer such as -1 or 0. So you are correct to change the double, but you should do it with a simple cast and you should do it consistently.
tanx , i forgot that part!
but still i cant get the first if block to execute ! i m really confused! whats wrong with it?