diff --git a/BAN/include/BAN/Math.h b/BAN/include/BAN/Math.h index b98356f3..30931ff3 100644 --- a/BAN/include/BAN/Math.h +++ b/BAN/include/BAN/Math.h @@ -1,5 +1,7 @@ #pragma once +#include + namespace BAN::Math { @@ -21,7 +23,7 @@ namespace BAN::Math return x < min ? min : x > max ? max : x; } - template + template T gcd(T a, T b) { T t; @@ -34,10 +36,16 @@ namespace BAN::Math return a; } - template + template T lcm(T a, T b) { return a / gcd(a, b) * b; } + template + T div_round_up(T a, T b) + { + return (a + b - 1) / b; + } + } \ No newline at end of file