#include #include #include "ulp.h" template void show(T x) { std::cout << std::setw(14) << x << "\t : " << std::setw(14) << ulp_down(x) << " < > " << ulp_up(x) << '\n'; } template void ulps(const char * msg) { std::cout << "\n" << msg << "\n"; auto max = std::numeric_limits::max(); auto min = std::numeric_limits::min(); auto inf = std::numeric_limits::infinity(); show(inf); show(max); show(T(2.0)); show(T(1.5)); show(T(1.0)); show(T(0.5)); show(min); show(T(0.0)); show(-min); show(T(-0.5)); show(T(-1.0)); show(T(-1.5)); show(T(-2.0)); show(-max); show(-inf); } int main() { ulps("double"); return 0; }