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