Two floating point values do not get added and printed on ESP-WROOM-32 I have a Olimex ESP32-PoE board which has a ESP-WROOM-32. 

I just found out a strange behaviour for printing floating point numbers on the board.

Sketch

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  float a=34567891.234;
  float b=2.3456;
  a++;
  Serial.print(a+b, 4);
  Serial.println("");
  delay(1000);
}


the sketch is extremely simple where I want to add two floating point numbers, one a big and another small to print their addition result upto 4 places.

Output

on the serial console in the Arduino IDE

34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000
34567896.0000


Everytime I increment the float a using a++ i expect it to increment by one and print the result but the output above is completely off.

Without Increment

void loop() {
  // put your main code here, to run repeatedly:
  float a=34567891.234;
  float b=2.3456;
  Serial.print(a+b, 4);
  Serial.println("");
  delay(1000);

}


output

34567896.0000
34567896.0000
34567896.0000


Same output.

Is this Board specific or is the Serial.print not supporting float?
Try doubles instead of floats. 

Your initial value, 34567891.234 needs 35 bits of precision to keep track of the decimals, but floats only have 24 bits pf precision. So to have enough precision to keep track of the difference between 34567891.234 and 34567891.234+1, you need higher precision storage.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  double a=34567891.234;
  double b=2.3456;
  a++;
  Serial.print(a+b, 4);
  Serial.println("");
  delay(1000);
}