Arduino build error

error: call of overloaded 'show(double)' is ambiguous

Two functions share a name and take different types. The value you passed fits both equally, so the compiler will not guess.

  • Build error
  • 2 common causes
  • Seen 487 times in failed builds on Mokxi in the 30 days to November 16, 2026.
The message

What the Arduino IDE prints

Output window
sketch.ino: In function 'void setup()':
sketch.ino:9:11: error: call of overloaded 'show(double)' is ambiguous
note: candidate: 'void show(int)'
note: candidate: 'void show(float)'
exit status 1

Say exactly which one you want by giving the value the exact type of one of them.

Mokxi's compiler, clang, words it as call to 'show' is ambiguous.

Causes

The 2 usual causes with the fix

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.

Broken
void show(int value) {
  Serial.println("int");
}

void show(float value) {
  Serial.println("float");
}

void setup() {
  Serial.begin(9600);
  show(2.5);
}

void loop() {
}
Fixed
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.

Try this fix in Mokxi

2A byte or char value meets two number versions

A value of another size, such as a long, fits several versions. Cast it to the type you mean.

Broken
void show(int value) {
  Serial.println("int");
}

void show(float value) {
  Serial.println("float");
}

void setup() {
  Serial.begin(9600);
  long big = 100000L;
  show(big);
}

void loop() {
}
Fixed
void show(int value) {
  Serial.println("int");
}

void show(float value) {
  Serial.println("float");
}

void setup() {
  Serial.begin(9600);
  long big = 100000L;
  show((float)big);
}

void loop() {
}

Mokxi’s build tab says: show has more than one version, and the values given fit two of them equally well.

Try this fix in Mokxi

FAQ

Questions and answers

What does "ambiguous" mean here?

The compiler found two functions that both fit and cannot tell which you meant.

Where do overloads come from?

Your own code, or a library. Serial.print, for example, is overloaded for many types.

How do I pick one?

Give the argument the exact type of one version, with a suffix such as 2.5f or a cast such as (float)x.