Here is a starting point to answer your question. I have simply divided by 2. Once you get to dividing by 2^^148, you come pretty close. You could then iteratively move closer and print out the hex representation of the number to see what the compiler is doing:
#include <iostream>
#include <stdio.h>
#include <limits>//is it here?
int main() {
double d_eps,invd_eps;
float f_eps,invf_eps;
invf_eps = 1.f/f_eps;//invf_eps should be finite
float last_seed = 0;
float seed = 1.0;
for(int i = 0; i < 1000000; i++) {
last_seed = seed;
seed = seed/2;
if(seed/2 == invd_eps) {
printf("Breaking at i = %d\n", i);
printf("Seed: %g, last seed: %g\n", seed, last_seed);
break;
}
}
printf("%f, %lf, %f, %lf\n\n", f_eps, d_eps, invf_eps, invd_eps);
return 0;
}
Output:
Breaking at i = 148
Seed: 1.4013e-45, last seed: 2.8026e-45
0.000000, 0.000000, inf, 0.000000
Process finished with exit code 0