fork download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. int main()
  5. {
  6. std::cout.precision(17);
  7. std::cout << std::nextafter(1.f, 0.f) << std::endl;
  8. std::cout << std::nextafter(1.f, 2.f) << std::endl;
  9. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
0.99999994039535522
1.0000001192092896