From 224d543d799f3e26a530b94d5ebf020add8e7e63 Mon Sep 17 00:00:00 2001 From: Matt Mascarenhas Date: Wed, 31 Aug 2016 00:44:14 +0100 Subject: [PATCH] Introduce HMM_PowerF() --- HandmadeMath.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/HandmadeMath.h b/HandmadeMath.h index 7981a46..da1c71c 100644 --- a/HandmadeMath.h +++ b/HandmadeMath.h @@ -644,6 +644,18 @@ HMM_Power(float Base, int Exponent) return (Result); } +HINLINE float +HMM_PowerF(float Base, float Exponent) +{ + if (Base > 0) + { + return expf(Exponent * logf(Base)); + } + else + { + return -expf(Exponent * logf(-Base)); + } +} HINLINE float HMM_Lerp(float A, float Time, float B)