it does. That's why 4.99999999999 makes 4.

If you want powers of two, why are you using floating point types at all?The processor is perfectly happy working in binary.

Quoteit does. That's why 4.99999999999 makes 4.ok, but why does it return 5.00 when displaying it's double form? It rounds for println purposes?

size_t Print::printFloat(double number, uint8_t digits) { size_t n = 0; if (isnan(number)) return print("nan"); if (isinf(number)) return print("inf"); if (number > 4294967040.0) return print ("ovf"); // constant determined empirically if (number <-4294967040.0) return print ("ovf"); // constant determined empirically // Handle negative numbers if (number < 0.0) { n += print('-'); number = -number; } // Round correctly so that print(1.999, 2) prints as "2.00" double rounding = 0.5; for (uint8_t i=0; i<digits; ++i) rounding /= 10.0; number += rounding; // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; double remainder = number - (double)int_part; n += print(int_part); // Print the decimal point, but only if there are digits beyond if (digits > 0) { n += print("."); } // Extract digits from the remainder one at a time while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); n += print(toPrint); remainder -= toPrint; } return n;}

BTW, what I'm trying to do basically... is count up in binary... to get this pattern:0000000100000011000001110000111100011111001111110111111111111111

void setup(){ Serial.begin(115200); int lines=8; int number=1; for (int s=lines-1;s>=0;s--){ for (int t=lines-1;t>=0;t--){ Serial.print(bitRead(number,t)); } Serial.println(); number<<=1; // bitshift number one to the left number+=1; // add 1 to the right most bit }}void loop(){}