void setup() {
Serial.begin(115200);
double distanceDelta = 0;
int ledsPerMeter = 100;
int factor = 3;
double constValue = 0.15;
double to = factor * constValue; // works not
double from = to - constValue;
double a = from - distanceDelta;
double b = a * ledsPerMeter;
double c = b + 1;
int d = c;
Serial.printf("factor(3)=%d\n", factor);
Serial.printf("constValue(0.15)=%f\n", constValue);
Serial.printf("to(0.45)=%f\n", to);
Serial.printf("from(0.3)=%f\n", from);
Serial.printf("a(0.3=)%f\n", a);
Serial.printf("b(30)=%f\n", b);
Serial.printf("c(31.0)=%.50f\n", c);
Serial.printf("d(31)=%d\n", d);
Serial.printf("d+1(32)=%d\n", d + 1);
}
void loop() {}