Power function.

I am relatively new to the Arduino programming environment and would greatly appreciate any help on what seems to be a rather confusing problem.
When I use the pow function in my programs I do not appear to get correct or consistent answers.
When I use the following code:

for (x=0 ; x<8 ; x++){
mx=pow(2,x);
Serial.println(mx);
delay(500);
}

I get this sequence of numbers coming from the serial monitor:
1,2,3,7,15,31,63,127

I am not sure why this is happening or what the cause is.
Thanks for any help,
Andrei

This question was recently discussed on the forum,
pow is a floating point function that is limited to the arduino floating point type

especially for powers of 2 there is a far faster and exacter solution

for (int x=0 ; x<8 ; x++)
{
int mx = 1 << x;
Serial.println(mx);
delay(500);
}

Cool, thank you very much. This will make my life a lot easier!

found it see - http://arduino.cc/forum/index.php/topic,59770.0.html - davekw7x explains it to the last bit