Last active
August 29, 2015 14:26
-
-
Save forkineye/d05909c5c0184c7300ae to your computer and use it in GitHub Desktop.
ESP8266 Arduino pow() issue with floats in loops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
Serial.begin(115200); | |
Serial.println(""); | |
float x = 2.0; | |
float y = 2.2; | |
int i; | |
for(i = 0; i < 10; i++) { | |
Serial.println(pow(i, x)); | |
Serial.println(pow(i, y)); // Fails to compile | |
} | |
Serial.println(pow(i, y)); // Compiles fine, 10 ^ 2.2 | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment