1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#pragma once #include <cmath> template<typename t> inline int iround(const t& val) { return int(std::round(val)); } template<typename t> inline unsigned uround(const t& val) { return std::round(std::fmax(t(0), val)); }