From: terencehill Date: Thu, 18 May 2017 13:17:36 +0000 (+0200) Subject: Restore ** operator instead of pow, optimize check by allowing an operand to be const... X-Git-Tag: xonotic-v0.8.5~2774 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=030bb4527cc20693d7ac93c65d6e65b607b76a7c;p=xonotic%2Fxonotic-data.pk3dir.git Restore ** operator instead of pow, optimize check by allowing an operand to be constant folded by the compiler --- 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;