#include <stdio.h>
#include <math.h>

double largestCfor(double A)
{
    double C = nextafter(1.0, 0);
    while (C*A >= A)
        C = nextafter(C, 0);
    return C;
}

int main() {
	double C = 1;
	for (double i = 0x1p-1022; isfinite(i); i *= 2) // loop through all possible exponents
	{
	    double c = largestCfor(i);
	    if (c < C) C = c;
	}
	
	printf("C                 = %.30f\n", C);
	printf("nextafter(1.0, 0) = %.30f\n", nextafter(1.0, 0));
	
	return 0;
}