8/3600 = 0.00222222222222222 I trying to print 6 decimals, but print 0.000000
If I do 3600/8 then print the reciprical I get 0.002222
int RFH = 8;
float Hr = 0;
double yy = 0;
float zz = 0;
void setup() {
Serial.begin(38400); // start serial for debug
delay(10);
}
void loop() {
delay(1000);
Serial.print("Value RFH= ");
Serial.println(RFH);
Serial.println("Compute RFH/3600 then Serial.print(value,6) sb 0.002222");
zz = RFH/3600 ; // Arduino 5 decimals 8/3600=.00222
Serial.print("Computed zz = RFH/3600 = ");
Serial.println(zz,6);
yy = RFH/3600;
Serial.print("Computed RFH/3600 Double = ");
Serial.println(yy,6);
Serial.println("Compute zz=3600/RFH then zz=1/zz then Serial.print(zz,6) sb 0.002222");
zz=3600/RFH; zz=1/zz;
Serial.print("Computed Reciprical = ");
Serial.println(zz,6);
}
PORT OPEN 38400
Value RFH= 8
Compute RFH/3600 then Serial.print(value,6) sb 0.002222
Computed zz = RFH/3600 = 0.000000
Computed RFH/3600 Double = 0.000000
Compute zz=3600/RFH then zz=1/zz then Serial.print(zz,6) sb 0.002222
Computed Reciprical = 0.002222
Value RFH= 8
Compute RFH/3600 then Serial.print(value,6) sb 0.002222
Computed zz = RFH/3600 = 0.000000
Computed RFH/3600 Double = 0.000000
Compute zz=3600/RFH then zz=1/zz then Serial.print(zz,6) sb 0.002222
Computed Reciprical = 0.002222
Value RFH= 8
Compute RFH/3600 then Serial.print(value,6) sb 0.002222
Computed zz = RFH/3600 = 0.000000
Computed RFH/3600 Double = 0.000000
Compute zz=3600/RFH then zz=1/zz then Serial.print(zz,6) sb 0.002222
Computed Reciprical = 0.002222
PORT CLOSED