From 030bb4527cc20693d7ac93c65d6e65b607b76a7c Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 18 May 2017 15:17:36 +0200 Subject: [PATCH] Restore ** operator instead of pow, optimize check by allowing an operand to be constant folded by the compiler --- qcsrc/client/hud/panel/physics.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index 67be2ac68..f34bff3b8 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -82,11 +82,11 @@ void HUD_Physics() } } - int acc_decimals = 2; + const int acc_decimals = 2; if(time > physics_update_time) { // workaround for ftos_decimals returning a negative 0 - if(discrete_acceleration > -1 / pow(10, acc_decimals) && discrete_acceleration < 0) + if(discrete_acceleration > -1 / (10 ** acc_decimals) && discrete_acceleration < 0) discrete_acceleration = 0; discrete_acceleration = acceleration; discrete_speed = speed; -- 2.39.2