#include #include #include #include "../include/interval.hpp" #include bool test1(){ using namespace boost::numeric; interval x = {-64, 63}; std::cout << "x = " << x; interval y(-128, 126); std::cout << "y = " << y; assert(operator+(x,x) == y); std::cout << "x + x =" << operator+(x, x); std::cout << "x - x = " << operator-(x, x); return true; } bool test2(){ using namespace boost::numeric; boost::numeric::interval x = {-64, 63}; std::cout << "x = " << x; std::cout << std::boolalpha << "(x == x) = " << (x == x) << std::endl; return true; } bool test3(){ using namespace boost::numeric; interval t; std::cout << "t = " << t; interval u; std::cout << "u = " << u; using max_t = unsigned long long; interval< max_t> r = operator+(t, u); std::cout << "r = " << r << std::endl; return true; } int main(){ return ( test1() && test2() && test3() ) ? EXIT_SUCCESS : EXIT_FAILURE; }