math/ceil_div.hpp
- View this file on GitHub
- Last update: 2022-10-01 07:25:57+00:00
- Include:
#include "math/ceil_div.hpp"
Code
#ifndef CEIL_DIV_HPP
#define CEIL_DIV_HPP
template <typename T> T ceil_div(T a, T b) {
return a / b + static_cast<T>((a ^ b) > 0 && a % b != 0);
}
#endif // CEIL_DIV_HPP#line 1 "math/ceil_div.hpp"
template <typename T> T ceil_div(T a, T b) {
return a / b + static_cast<T>((a ^ b) > 0 && a % b != 0);
}