#include <cfloat> // DBL_MAX
#include <cmath> // std::nextafter
#include <random>
#include <iostream>
int main()
{
const double start = -1.0;
const double end = 1.0;
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_real_distribution<> dis(start, std::nextafter(end, DBL_MAX));
for (auto i = 0; i < 100; ++i)
{
std::cout << dis(gen) << "\n";
}
std::cout << std::endl;
}
I2luY2x1ZGUgPGNmbG9hdD4gLy8gREJMX01BWAojaW5jbHVkZSA8Y21hdGg+IC8vIHN0ZDo6bmV4dGFmdGVyCiNpbmNsdWRlIDxyYW5kb20+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCmludCBtYWluKCkKewogIGNvbnN0IGRvdWJsZSBzdGFydCA9IC0xLjA7CiAgY29uc3QgZG91YmxlIGVuZCA9IDEuMDsKCiAgc3RkOjpyYW5kb21fZGV2aWNlIHJkOwogIHN0ZDo6bXQxOTkzNyBnZW4ocmQoKSk7CiAgc3RkOjp1bmlmb3JtX3JlYWxfZGlzdHJpYnV0aW9uPD4gZGlzKHN0YXJ0LCBzdGQ6Om5leHRhZnRlcihlbmQsIERCTF9NQVgpKTsKCiAgZm9yIChhdXRvIGkgPSAwOyBpIDwgMTAwOyArK2kpCiAgewogICAgc3RkOjpjb3V0IDw8IGRpcyhnZW4pIDw8ICJcbiI7CiAgfQogIHN0ZDo6Y291dCA8PCBzdGQ6OmVuZGw7Cn0=