890 likes | 990 Views
// ulps.h: Counts the FP intervals between two FP numbers. #include <algorithm>. #include <cassert>. #include <cstdlib>. #include <cmath>. #include <limits>. template<typename FType>. int sign(const FType& x) {. return x < FType(0) ? -1 : x > FType(0) ? 1 : 0;. }.
E N D
// Find largest exponent of base <= z ("glb" = "base"^"exp").
long double inf = std::numeric_limits<long double>::infinity();
static_cast<long double>(std::numeric_limits<FType>::epsilon());