mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-15 15:37:51 -04:00
Add std::ceil_divide
This commit is contained in:
parent
afd3cde5c2
commit
395e6ec8db
20
tstl/include/math.hpp
Normal file
20
tstl/include/math.hpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//=======================================================================
|
||||||
|
// Copyright Baptiste Wicht 2013-2016.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
#ifndef MATH_HPP
|
||||||
|
#define MATH_HPP
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T ceil_divide(T base, T divisor){
|
||||||
|
return (base + divisor - 1) / divisor;
|
||||||
|
}
|
||||||
|
|
||||||
|
} //end of namespace std
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user