1A decimal number meets an int and a float version
A number written as 2.5 is a double. It is as close to float as it is to int, so neither wins. Write 2.5f for a float.
void show(int value) {
Serial.println("int");
}
void show(float value) {
Serial.println("float");
}
void setup() {
Serial.begin(9600);
show(2.5);
}
void loop() {
}void show(int value) {
Serial.println("int");
}
void show(float value) {
Serial.println("float");
}
void setup() {
Serial.begin(9600);
show(2.5f);
}
void loop() {
}Mokxi’s build tab says: show has more than one version, and the values given fit two of them equally well.