maths: make pow more readable

This commit is contained in:
Danny Robson 2015-10-12 23:56:59 +11:00
parent 3e884113fd
commit 02e0885ee9

View File

@ -38,7 +38,10 @@ template <typename T>
constexpr T
pow (T x, unsigned y)
{
return y == 0 ? 1 : x * pow (x, y - 1);
if (y == 0)
return T(1);
return x * ::pow (x, y - 1);
}