What is the biggest \"no-floating\" integer that can be stored in an IEEE 754 double type without losing precision ?
9007199254740992 (that's 9,007,199,254,740,992) with no guarantees :)
Program
#include
#include
int main(void) {
double dbl = 0; /* I started with 9007199254000000, a little less than 2^53 */
while (dbl + 1 != dbl) dbl++;
printf("%.0f\n", dbl - 1);
printf("%.0f\n", dbl);
printf("%.0f\n", dbl + 1);
return 0;
}
Result
9007199254740991 9007199254740992 9007199254740992