#include <iostream>
#include <cmath>
#include <cfloat>

int main()
{
    double d = 1'000'000;
    double nextEpsilon = d + DBL_EPSILON;
    double next = nextafter(d, 2 * d);

    std::cout.precision(17);
    std::cout << d << std::endl;
    std::cout << nextEpsilon << std::endl;
    std::cout << next << std::endl;

    if (d == nextEpsilon) {
        std::cout << "nextEpsilon is identical\n";   
    }
    if (d == next) {
        std::cout << "next is identical\n";
    }
}