#include #include #include int main() { double inf = 1.0/0.0; double minf = (-1.0)/0.0; std::cout << "value just before inf (should be valmax)" << std::endl; std::cout << "libc: " << ::nextafter(inf, 0) << std::endl; std::cout << "boost.math: " << boost::math::tr1::nextafter(inf, 0) << std::endl; std::cout << std::endl; std::cout << "value just after minf (should be valmin)" << std::endl; std::cout << "libc: " << ::nextafter(minf, 0) << std::endl; std::cout << "boost.math: " << boost::math::tr1::nextafter(minf, 0) << std::endl; std::cout << std::endl; }