From 02e0885ee9ada0cd0abc45141337a753143a653e Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 12 Oct 2015 23:56:59 +1100 Subject: [PATCH] maths: make pow more readable --- maths.ipp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maths.ipp b/maths.ipp index 72e328f3..d2f11baa 100644 --- a/maths.ipp +++ b/maths.ipp @@ -38,7 +38,10 @@ template 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); }