]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
pow(a, b) -> a ** b
authorMario <mario@smbclan.net>
Mon, 6 Mar 2017 19:12:09 +0000 (05:12 +1000)
committerMario <mario@smbclan.net>
Mon, 6 Mar 2017 19:12:09 +0000 (05:12 +1000)
30 files changed:
qcsrc/client/hud/panel/physics.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/view.qc
qcsrc/common/command/rpn.qc
qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/physics/player.qc
qcsrc/common/triggers/trigger/impulse.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/util.qc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/lib/math.qh
qcsrc/lib/noise.qh
qcsrc/lib/warpzone/mathlib.qc
qcsrc/menu/xonotic/slider_picmip.qc
qcsrc/server/bot/default/aim.qc
qcsrc/server/bot/default/bot.qc
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/scripting.qc
qcsrc/server/cheats.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/scores.qc
qcsrc/server/spawnpoints.qc

index 6befd1a30a4fe161ea57e386def9eb33f0e2bbfe..42f6512c0fc22bfa2d270c6fbdf6aa7e59bebf15 100644 (file)
@@ -86,7 +86,7 @@ void HUD_Physics()
        if(time > physics_update_time)
        {
                // workaround for ftos_decimals returning a negative 0
        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;
                        discrete_acceleration = 0;
                discrete_acceleration = acceleration;
                discrete_speed = speed;
index f3d55a433e8db1792ddc098c8bd71e7f4b0186f8..972e4effbee9db71c90b4228e177e5a1eb4f8108 100644 (file)
@@ -180,7 +180,7 @@ void HUD_Score()
                        // distribution display
                        distribution = me.(scores(ps_primary)) - pl.(scores(ps_primary));
 
                        // distribution display
                        distribution = me.(scores(ps_primary)) - pl.(scores(ps_primary));
 
-                       distrtimer = ftos_decimals(fabs(distribution/pow(10, TIME_DECIMALS)), TIME_DECIMALS);
+                       distrtimer = ftos_decimals(fabs(distribution/(10 ** TIME_DECIMALS)), TIME_DECIMALS);
 
                        if (distribution <= 0) {
                                distribution_color = '0 1 0';
 
                        if (distribution <= 0) {
                                distribution_color = '0 1 0';
index acdb69fdcd9276e3ba6551acb384ca40ad7ad42d..104405b3973616eb2ce156a97fe06a90ac34e536 100644 (file)
@@ -522,7 +522,7 @@ vector GetCurrentFov(float fov)
                current_zoomfraction = (current_viewzoom - 1) / (1/zoomfactor - 1);
 
        if(zoomsensitivity < 1)
                current_zoomfraction = (current_viewzoom - 1) / (1/zoomfactor - 1);
 
        if(zoomsensitivity < 1)
-               setsensitivityscale(pow(current_viewzoom, 1 - zoomsensitivity));
+               setsensitivityscale(current_viewzoom ** (1 - zoomsensitivity));
        else
                setsensitivityscale(1);
 
        else
                setsensitivityscale(1);
 
@@ -1735,7 +1735,7 @@ void CSQC_UpdateView(entity this, float w, float h)
 
                t = (time - blurtest_time0) / (blurtest_time1 - blurtest_time0);
                r = t * blurtest_radius;
 
                t = (time - blurtest_time0) / (blurtest_time1 - blurtest_time0);
                r = t * blurtest_radius;
-               f = 1 / pow(t, blurtest_power) - 1;
+               f = 1 / (t ** blurtest_power) - 1;
 
                cvar_set("r_glsl_postprocess", "1");
                cvar_set("r_glsl_postprocess_uservec1", strcat(ftos(r), " ", ftos(f), " 0 0"));
 
                cvar_set("r_glsl_postprocess", "1");
                cvar_set("r_glsl_postprocess_uservec1", strcat(ftos(r), " ", ftos(f), " 0 0"));
index f88bf635ee665b9628f0e69f0a6b1d1d58b430a8..828fbdf7dd7850004caa793a342896077a5530e4 100644 (file)
@@ -164,7 +164,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                rpn_setf(f2 - f * floor(f2 / f));
                                        } else if(rpncmd == "pow" || rpncmd == "**") {
                                                f = rpn_popf();
                                                rpn_setf(f2 - f * floor(f2 / f));
                                        } else if(rpncmd == "pow" || rpncmd == "**") {
                                                f = rpn_popf();
-                                               rpn_setf(pow(rpn_getf(), f));
+                                               rpn_setf(rpn_getf() ** f);
                                        } else if(rpncmd == "bitand" || rpncmd == "&") {
                                                f = rpn_popf();
                                                rpn_setf(rpn_getf() & f);
                                        } else if(rpncmd == "bitand" || rpncmd == "&") {
                                                f = rpn_popf();
                                                rpn_setf(rpn_getf() & f);
index a67e9455d9233640030bd1e0b879ff7b980ee0e8..729fbbad06b9ef459784e1d2f0f2d0ef5dfde471 100644 (file)
@@ -97,7 +97,7 @@ void RaceCarPhysics(entity this, float dt)
                float upspeed = this.velocity * v_up;
 
                // responsiveness factor for steering and acceleration
                float upspeed = this.velocity * v_up;
 
                // responsiveness factor for steering and acceleration
-               float f = 1 / (1 + pow(max(-myspeed, myspeed) / PHYS_BUGRIGS_SPEED_REF(this), PHYS_BUGRIGS_SPEED_POW(this)));
+               float f = 1 / (1 + (max(-myspeed, myspeed) / PHYS_BUGRIGS_SPEED_REF(this) ** PHYS_BUGRIGS_SPEED_POW(this)));
                //MAXIMA: f(v) := 1 / (1 + (v / PHYS_BUGRIGS_SPEED_REF(this)) ^ PHYS_BUGRIGS_SPEED_POW(this));
 
                float steerfactor;
                //MAXIMA: f(v) := 1 / (1 + (v / PHYS_BUGRIGS_SPEED_REF(this)) ^ PHYS_BUGRIGS_SPEED_POW(this));
 
                float steerfactor;
@@ -154,7 +154,7 @@ void RaceCarPhysics(entity this, float dt)
                float myspeed = vlen(this.velocity);
 
                // responsiveness factor for steering and acceleration
                float myspeed = vlen(this.velocity);
 
                // responsiveness factor for steering and acceleration
-               float f = 1 / (1 + pow(max(0, myspeed / PHYS_BUGRIGS_SPEED_REF(this)), PHYS_BUGRIGS_SPEED_POW(this)));
+               float f = 1 / (1 + (max(0, myspeed / PHYS_BUGRIGS_SPEED_REF(this)) ** PHYS_BUGRIGS_SPEED_POW(this)));
                float steerfactor = -myspeed * f;
                this.angles_y += steer * dt * steerfactor; // apply steering
 
                float steerfactor = -myspeed * f;
                this.angles_y += steer * dt * steerfactor; // apply steering
 
index 413dd99f59c1ee0fde9706d9a4900c3954a5496f..45e6d997e836c7cb6a76326bc9ec4149bc4e285a 100644 (file)
@@ -577,7 +577,7 @@ void nade_entrap_touch(entity this, entity toucher)
                if(!pushdeltatime) return;
 
                // div0: ticrate independent, 1 = identity (not 20)
                if(!pushdeltatime) return;
 
                // div0: ticrate independent, 1 = identity (not 20)
-               toucher.velocity = toucher.velocity * pow(autocvar_g_nades_entrap_strength, pushdeltatime);
+               toucher.velocity = toucher.velocity * (autocvar_g_nades_entrap_strength ** pushdeltatime);
 
        #ifdef SVQC
                UpdateCSQCProjectile(toucher);
 
        #ifdef SVQC
                UpdateCSQCProjectile(toucher);
index bdedf295d8b7e31a967b0b9b1f4a51248618d589..81f54b1c903807612713536ae6081ca311c77554 100644 (file)
@@ -460,7 +460,7 @@ vector fixrgbexcess(vector rgb)
 void Draw_WaypointSprite(entity this)
 {
     if (this.lifetime > 0)
 void Draw_WaypointSprite(entity this)
 {
     if (this.lifetime > 0)
-        this.alpha = pow(bound(0, (this.fadetime - time) / this.lifetime, 1), waypointsprite_timealphaexponent);
+        this.alpha = (bound(0, (this.fadetime - time) / this.lifetime, 1) ** waypointsprite_timealphaexponent);
     else
         this.alpha = 1;
 
     else
         this.alpha = 1;
 
@@ -522,9 +522,9 @@ void Draw_WaypointSprite(entity this)
     float a = this.alpha * autocvar_hud_panel_fg_alpha;
 
     if (this.maxdistance > waypointsprite_normdistance)
     float a = this.alpha * autocvar_hud_panel_fg_alpha;
 
     if (this.maxdistance > waypointsprite_normdistance)
-        a *= pow(bound(0, (this.maxdistance - dist) / (this.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent);
+        a *= (bound(0, (this.maxdistance - dist) / (this.maxdistance - waypointsprite_normdistance), 1) ** waypointsprite_distancealphaexponent);
     else if (this.maxdistance > 0)
     else if (this.maxdistance > 0)
-        a *= pow(bound(0, (waypointsprite_fadedistance - dist) / (waypointsprite_fadedistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent) * (1 - waypointsprite_minalpha) + waypointsprite_minalpha;
+        a *= (bound(0, (waypointsprite_fadedistance - dist) / (waypointsprite_fadedistance - waypointsprite_normdistance), 1) ** waypointsprite_distancealphaexponent) * (1 - waypointsprite_minalpha) + waypointsprite_minalpha;
 
     vector rgb = spritelookupcolor(this, spriteimage, this.teamradar_color);
     if (rgb == '0 0 0')
 
     vector rgb = spritelookupcolor(this, spriteimage, this.teamradar_color);
     if (rgb == '0 0 0')
@@ -611,7 +611,7 @@ void Draw_WaypointSprite(entity this)
     (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o.x,
     (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o.y);
 
     (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o.x,
     (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o.y);
 
-    float crosshairdistance = sqrt( pow(o.x - vid_conwidth/2, 2) + pow(o.y - vid_conheight/2, 2) );
+    float crosshairdistance = sqrt( ((o.x - vid_conwidth/2) ** 2) + ((o.y - vid_conheight/2) ** 2) );
 
     t = waypointsprite_scale;
     a *= waypointsprite_alpha;
 
     t = waypointsprite_scale;
     a *= waypointsprite_alpha;
index 6c1ec31cec6cd80bbe74e65fa8890f7e55578102..a8a32998e48f8f01cc6c45f7dad82024e92ffe4d 100644 (file)
@@ -85,7 +85,7 @@ float GeomLerp(float a, float _lerp, float b)
 {
        return a == 0 ? (_lerp < 1 ? 0 : b)
                : b == 0 ? (_lerp > 0 ? 0 : a)
 {
        return a == 0 ? (_lerp < 1 ? 0 : b)
                : b == 0 ? (_lerp > 0 ? 0 : a)
-               : a * pow(fabs(b / a), _lerp);
+               : a * (fabs(b / a) ** _lerp);
 }
 
 void PM_ClientMovement_UpdateStatus(entity this)
 }
 
 void PM_ClientMovement_UpdateStatus(entity this)
@@ -153,7 +153,7 @@ void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed)
 
        if (dot > 0) // we can't change direction while slowing down
        {
 
        if (dot > 0) // we can't change direction while slowing down
        {
-               k *= pow(dot, PHYS_AIRCONTROL_POWER(this)) * dt;
+               k *= (dot ** PHYS_AIRCONTROL_POWER(this)) * dt;
                xyspeed = max(0, xyspeed - PHYS_AIRCONTROL_PENALTY(this) * sqrt(max(0, 1 - dot*dot)) * k/32);
                k *= PHYS_AIRCONTROL(this);
                this.velocity = normalize(this.velocity * xyspeed + wishdir * k);
                xyspeed = max(0, xyspeed - PHYS_AIRCONTROL_PENALTY(this) * sqrt(max(0, 1 - dot*dot)) * k/32);
                k *= PHYS_AIRCONTROL(this);
                this.velocity = normalize(this.velocity * xyspeed + wishdir * k);
index cb9c2d293558fad6829c7e888a08c9cfc63c0f40..4be6e86bca66c6c02fcf2adbd3c7141721292647 100644 (file)
@@ -74,7 +74,7 @@ void trigger_impulse_touch2(entity this, entity toucher)
        if(!pushdeltatime) return;
 
        // div0: ticrate independent, 1 = identity (not 20)
        if(!pushdeltatime) return;
 
        // div0: ticrate independent, 1 = identity (not 20)
-       toucher.velocity = toucher.velocity * pow(this.strength, pushdeltatime);
+       toucher.velocity = toucher.velocity * (this.strength ** pushdeltatime);
 
 #ifdef SVQC
        UpdateCSQCProjectile(toucher);
 
 #ifdef SVQC
        UpdateCSQCProjectile(toucher);
@@ -181,7 +181,7 @@ spawnfunc(trigger_impulse)
                else
                {
                        if(!this.strength) this.strength = 0.9;
                else
                {
                        if(!this.strength) this.strength = 0.9;
-                       this.strength = pow(this.strength, autocvar_g_triggerimpulse_accel_power) * autocvar_g_triggerimpulse_accel_multiplier;
+                       this.strength = (this.strength ** autocvar_g_triggerimpulse_accel_power) * autocvar_g_triggerimpulse_accel_multiplier;
                        settouch(this, trigger_impulse_touch2);
                }
        }
                        settouch(this, trigger_impulse_touch2);
                }
        }
index c21e327d4470655336e6033d1823587c65f6e458..c2cc03e73806986ade725c89731bbd3bfdcb17ac 100644 (file)
@@ -105,9 +105,9 @@ void turret_draw2d(entity this)
 
 
        if(this.maxdistance > waypointsprite_normdistance)
 
 
        if(this.maxdistance > waypointsprite_normdistance)
-               a *= pow(bound(0, (this.maxdistance - dist) / (this.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent);
+               a *= (bound(0, (this.maxdistance - dist) / (this.maxdistance - waypointsprite_normdistance), 1) ** waypointsprite_distancealphaexponent);
        else if(this.maxdistance > 0)
        else if(this.maxdistance > 0)
-               a *= pow(bound(0, (waypointsprite_fadedistance - dist) / (waypointsprite_fadedistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent) * (1 - waypointsprite_minalpha) + waypointsprite_minalpha;
+               a *= (bound(0, (waypointsprite_fadedistance - dist) / (waypointsprite_fadedistance - waypointsprite_normdistance), 1) ** waypointsprite_distancealphaexponent) * (1 - waypointsprite_minalpha) + waypointsprite_minalpha;
 
        if(rgb == '0 0 0')
        {
 
        if(rgb == '0 0 0')
        {
@@ -161,7 +161,7 @@ void turret_draw2d(entity this)
        (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x,
        (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y);
 
        (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x,
        (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y);
 
-       float crosshairdistance = sqrt( pow(o.x - vid_conwidth/2, 2) + pow(o.y - vid_conheight/2, 2) );
+       float crosshairdistance = sqrt( (o.x - vid_conwidth/2 ** 2) + (o.y - vid_conheight/2 ** 2) );
 
        t = waypointsprite_scale;
        a *= waypointsprite_alpha;
 
        t = waypointsprite_scale;
        a *= waypointsprite_alpha;
index 38514e9270b7f457bbf8590d1d26f091af641272..22737078c12eb3905ebfc6cc84d02ae58b2a63ba 100644 (file)
@@ -326,7 +326,7 @@ float compressShortVector(vector vec)
 STATIC_INIT(compressShortVector)
 {
        float l = 1;
 STATIC_INIT(compressShortVector)
 {
        float l = 1;
-       float f = pow(2, 1/8);
+       float f = (2 ** 1/8);
        int i;
        for(i = 0; i < 128; ++i)
        {
        int i;
        for(i = 0; i < 128; ++i)
        {
index a694112ce6672ab57a176fc720b8df8c7ace4a5e..8af381f09119b612bfe445a0963ca910be879af0 100644 (file)
@@ -67,11 +67,11 @@ WepSet _WepSet_FromWeapon(int a)
                                if (a >= 24)
                                {
                                        a -= 24;
                                if (a >= 24)
                                {
                                        a -= 24;
-                                       return '0 0 1' * power2of(a);
+                                       return '0 0 1' * (2 ** a);
                                }
                                }
-                       return '0 1 0' * power2of(a);
+                       return '0 1 0' * (2 ** a);
                }
                }
-       return '1 0 0' * power2of(a);
+       return '1 0 0' * (2 ** a);
 }
 #ifdef SVQC
        void WriteWepSet(float dst, WepSet w)
 }
 #ifdef SVQC
        void WriteWepSet(float dst, WepSet w)
index 8268acdd3091bf89bf0ee1749c0c5ec4627ec605..2915045216698336699c334f26fe7b6999b2404c 100644 (file)
@@ -181,9 +181,9 @@ vector W_Crylink_LinkJoin(entity e, float jspeed)
                return avg_origin; // nothing to do
 
        // yes, mathematically we can do this in ONE step, but beware of 32bit floats...
                return avg_origin; // nothing to do
 
        // yes, mathematically we can do this in ONE step, but beware of 32bit floats...
-       avg_dist = pow(vlen(e.origin - avg_origin), 2);
+       avg_dist = (vlen(e.origin - avg_origin) ** 2);
        for(p = e; (p = p.queuenext) != e; )
        for(p = e; (p = p.queuenext) != e; )
-               avg_dist += pow(vlen(WarpZone_RefSys_TransformOrigin(p, e, p.origin) - avg_origin), 2);
+               avg_dist += (vlen(WarpZone_RefSys_TransformOrigin(p, e, p.origin) - avg_origin) ** 2);
        avg_dist *= (1.0 / n);
        avg_dist = sqrt(avg_dist);
 
        avg_dist *= (1.0 / n);
        avg_dist = sqrt(avg_dist);
 
index 15dfe0169dbacf483f703f6431780395a8df9eeb..1eea1dfd5811d743fca0086020e3e22d23a7d3b5 100644 (file)
@@ -85,7 +85,7 @@ void W_Hook_ExplodeThink(entity this)
        float dt, dmg_remaining_next, f;
 
        dt = time - this.teleport_time;
        float dt, dmg_remaining_next, f;
 
        dt = time - this.teleport_time;
-       dmg_remaining_next = pow(bound(0, 1 - dt / this.dmg_duration, 1), this.dmg_power);
+       dmg_remaining_next = (bound(0, 1 - dt / this.dmg_duration, 1) ** this.dmg_power);
 
        f = this.dmg_last - dmg_remaining_next;
        this.dmg_last = dmg_remaining_next;
 
        f = this.dmg_last - dmg_remaining_next;
        this.dmg_last = dmg_remaining_next;
index 988ee7355664f15cc045583c6a074b4df1d55be1..1536eb337bc75482edb37f9cfaa165301ecbc17b 100644 (file)
@@ -493,23 +493,23 @@ void tubasound(entity e, bool restart)
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
                                }
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
                                }
-                               speed1 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
+                               speed1 = (2.0 ** (m - Tuba_PitchStep) / 12.0);
                        } else if (e.note - m + Tuba_PitchStep > TUBA_MAX) {
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
                                }
                        } else if (e.note - m + Tuba_PitchStep > TUBA_MAX) {
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
                                }
-                               speed1 = pow(2.0, m / 12.0);
+                               speed1 = (2.0 ** m / 12.0);
                        } else {
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
                                }
                                vol1 = cos(M_PI_2 * m / Tuba_PitchStep);
                        } else {
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
                                }
                                vol1 = cos(M_PI_2 * m / Tuba_PitchStep);
-                               speed1 = pow(2.0, m / 12.0);
+                               speed1 = (2.0 ** m / 12.0);
                                if (restart) {
                                        snd2 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
                                }
                                vol2 = sin(M_PI_2 * m / Tuba_PitchStep);
                                if (restart) {
                                        snd2 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
                                }
                                vol2 = sin(M_PI_2 * m / Tuba_PitchStep);
-                               speed2 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
+                               speed2 = (2.0 ** (m - Tuba_PitchStep) / 12.0);
                        }
                } else if (restart) {
                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
                        }
                } else if (restart) {
                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
index 94cdcc6710c2627ef76890036b12ba719bfff365..de6cb95c37c4e9b971c0b2e350cea712adee9b54 100644 (file)
@@ -5,16 +5,16 @@
 void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
 {
        if (weight == 0) return;
 void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
 {
        if (weight == 0) return;
-       if (mean == 0) e.(a) *= pow(value, weight);
-       else e.(a) += pow(value, mean) * weight;
+       if (mean == 0) e.(a) *= (value ** weight);
+       else e.(a) += (value ** mean) * weight;
        e.(c) += weight;
 }
 
 float mean_evaluate(entity e, .float a, .float c, float mean)
 {
        if (e.(c) == 0) return 0;
        e.(c) += weight;
 }
 
 float mean_evaluate(entity e, .float a, .float c, float mean)
 {
        if (e.(c) == 0) return 0;
-       if (mean == 0) return pow(e.(a), 1.0 / e.(c));
-       else return pow(e.(a) / e.(c), 1.0 / mean);
+       if (mean == 0) return (e.(a) ** (1.0 / e.(c)));
+       else return ((e.(a) / e.(c)) ** (1.0 / mean));
 }
 
 #define MEAN_ACCUMULATE(s, prefix, v, w) mean_accumulate(s, prefix##_accumulator, prefix##_count, prefix##_mean, v, w)
 }
 
 #define MEAN_ACCUMULATE(s, prefix, v, w) mean_accumulate(s, prefix##_accumulator, prefix##_count, prefix##_mean, v, w)
@@ -193,14 +193,14 @@ float almost_in_bounds(float a, float b, float c)
 
 float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d)
 {
 
 float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d)
 {
-       if (halflifedist > 0) return pow(0.5, (bound(mindist, d, maxdist) - mindist) / halflifedist);
-       else if (halflifedist < 0) return pow(0.5, (bound(mindist, d, maxdist) - maxdist) / halflifedist);
+       if (halflifedist > 0) return (0.5 ** (bound(mindist, d, maxdist) - mindist) / halflifedist);
+       else if (halflifedist < 0) return (0.5 ** (bound(mindist, d, maxdist) - maxdist) / halflifedist);
        else return 1;
 }
 
 float power2of(float e)
 {
        else return 1;
 }
 
 float power2of(float e)
 {
-       return pow(2, e);
+       return (2 ** e);
 }
 
 float log2of(float e)
 }
 
 float log2of(float e)
index 9b1b472242b307697897c2a4492dec5dc5fa221d..40647b30ebe8ee1ee090d313360cb136bbffb5ed 100644 (file)
@@ -18,9 +18,9 @@ float Noise_Pink(entity e, float dt)
        float f;
        f = dt * 60;
        // http://home.earthlink.net/~ltrammell/tech/pinkalg.htm
        float f;
        f = dt * 60;
        // http://home.earthlink.net/~ltrammell/tech/pinkalg.htm
-       if (random() > pow(0.3190, f)) e.noise_paccum = 0.34848 * (2 * random() - 1);
-       if (random() > pow(0.7756, f)) e.noise_paccum2 = 0.28768 * (2 * random() - 1);
-       if (random() > pow(0.9613, f)) e.noise_paccum3 = 0.43488 * (2 * random() - 1);
+       if (random() > (0.3190 ** f)) e.noise_paccum = 0.34848 * (2 * random() - 1);
+       if (random() > (0.7756 ** f)) e.noise_paccum2 = 0.28768 * (2 * random() - 1);
+       if (random() > (0.9613 ** f)) e.noise_paccum3 = 0.43488 * (2 * random() - 1);
        return e.noise_paccum + e.noise_paccum2 + e.noise_paccum3;
 }
 float Noise_White(entity e, float dt)
        return e.noise_paccum + e.noise_paccum2 + e.noise_paccum3;
 }
 float Noise_White(entity e, float dt)
@@ -30,6 +30,6 @@ float Noise_White(entity e, float dt)
 /** +1 or -1 */
 float Noise_Burst(entity e, float dt, float p)
 {
 /** +1 or -1 */
 float Noise_Burst(entity e, float dt, float p)
 {
-       if (random() > pow(p, dt)) e.noise_bstate = !e.noise_bstate;
+       if (random() > (p ** dt)) e.noise_bstate = !e.noise_bstate;
        return 2 * e.noise_bstate - 1;
 }
        return 2 * e.noise_bstate - 1;
 }
index e190518275b9c407570efae466fbdcb7ef758898..816a7ec6e761aa91f774a5ea8406e45b1a5775ae 100644 (file)
@@ -63,11 +63,11 @@ float tanh(float e)
 
 float exp(float e)
 {
 
 float exp(float e)
 {
-       return pow(M_E, e);
+       return (M_E ** e);
 }
 float exp2(float e)
 {
 }
 float exp2(float e)
 {
-       return pow(2, e);
+       return (2 ** e);
 }
 float expm1(float e)
 {
 }
 float expm1(float e)
 {
@@ -79,7 +79,7 @@ vector frexp(float e)
        vector v;
        v.z = 0;
        v.y = ilogb(e) + 1;
        vector v;
        v.z = 0;
        v.y = ilogb(e) + 1;
-       v.x = e / exp2(v.y);
+       v.x = e / (2 ** v.y);
        return v;
 }
 int ilogb(float e)
        return v;
 }
 int ilogb(float e)
@@ -88,7 +88,7 @@ int ilogb(float e)
 }
 float ldexp(float e, int e)
 {
 }
 float ldexp(float e, int e)
 {
-       return e * pow(2, e);
+       return e * (2 ** e);
 }
 float logn(float e, float base)
 {
 }
 float logn(float e, float base)
 {
@@ -117,12 +117,12 @@ vector modf(float f)
 
 float scalbn(float e, int n)
 {
 
 float scalbn(float e, int n)
 {
-       return e * pow(2, n);
+       return e * (2 ** n);
 }
 
 float cbrt(float e)
 {
 }
 
 float cbrt(float e)
 {
-       return copysign(pow(fabs(e), 1.0/3.0), e);
+       return copysign((fabs(e) ** 1.0/3.0), e);
 }
 float hypot(float e, float f)
 {
 }
 float hypot(float e, float f)
 {
index 226f4559c3425c9ac748a3bb32559b8b61c54042..c6b7c1e8cc7b5cbaaace86d9bb4cd5fedd8b4e06 100644 (file)
@@ -18,8 +18,8 @@ float texmemsize(float s3tc)
 {
        return
        (
 {
        return
        (
-                 2500 * pow(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
-               + 1500 * pow(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
+                 2500 * (0.25 ** max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
+               + 1500 * (0.25 ** max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
        ) * ((s3tc && (cvar("r_texture_dds_load") || cvar("gl_texturecompression"))) ? 0.2 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average
 }
 void XonoticPicmipSlider_autofix(entity me)
        ) * ((s3tc && (cvar("r_texture_dds_load") || cvar("gl_texturecompression"))) ? 0.2 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average
 }
 void XonoticPicmipSlider_autofix(entity me)
index c278be915a2278a3eabd89966c990cf6ad44c75e..b16de9afabd47ea17239a5f906d308eecb5a5941 100644 (file)
@@ -229,7 +229,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation)
        this.bot_5th_order_aimfilter= this.bot_5th_order_aimfilter
                + (this.bot_4th_order_aimfilter - this.bot_5th_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_5th,1);
 
        this.bot_5th_order_aimfilter= this.bot_5th_order_aimfilter
                + (this.bot_4th_order_aimfilter - this.bot_5th_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_5th,1);
 
-       //blend = (bound(0,skill,10)*0.1)*pow(1-bound(0,skill,10)*0.05,2.5)*5.656854249; //Plot formule before changing !
+       //blend = (bound(0,skill,10)*0.1)*((1-bound(0,skill,10)*0.05) ** 2.5)*5.656854249; //Plot formule before changing !
        blend = bound(0,skill+this.bot_aimskill,10)*0.1;
        desiredang = desiredang + blend *
        (
        blend = bound(0,skill+this.bot_aimskill,10)*0.1;
        desiredang = desiredang + blend *
        (
@@ -281,7 +281,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation)
        blendrate = autocvar_bot_ai_aimskill_blendrate;
        r = max(fixedrate, blendrate);
        //this.v_angle = this.v_angle + diffang * bound(frametime, r * frametime * (2+skill*skill*0.05-random()*0.05*(10-skill)), 1);
        blendrate = autocvar_bot_ai_aimskill_blendrate;
        r = max(fixedrate, blendrate);
        //this.v_angle = this.v_angle + diffang * bound(frametime, r * frametime * (2+skill*skill*0.05-random()*0.05*(10-skill)), 1);
-       this.v_angle = this.v_angle + diffang * bound(delta_t, r * delta_t * (2+pow(skill+this.bot_mouseskill,3)*0.005-random()), 1);
+       this.v_angle = this.v_angle + diffang * bound(delta_t, r * delta_t * (2+(skill+this.bot_mouseskill ** 3)*0.005-random()), 1);
        this.v_angle = this.v_angle * bound(0,autocvar_bot_ai_aimskill_mouse,1) + desiredang * bound(0,(1-autocvar_bot_ai_aimskill_mouse),1);
        //this.v_angle = this.v_angle + diffang * bound(0, r * frametime * (skill * 0.5 + 2), 1);
        //this.v_angle = this.v_angle + diffang * (1/ blendrate);
        this.v_angle = this.v_angle * bound(0,autocvar_bot_ai_aimskill_mouse,1) + desiredang * bound(0,(1-autocvar_bot_ai_aimskill_mouse),1);
        //this.v_angle = this.v_angle + diffang * bound(0, r * frametime * (skill * 0.5 + 2), 1);
        //this.v_angle = this.v_angle + diffang * (1/ blendrate);
index c598473903fb60b46720ef437b617c339302a65c..bcdc32e8d5e274154590f33cc290c859c7d1adab 100644 (file)
@@ -64,7 +64,7 @@ void bot_think(entity this)
        if(autocvar_bot_god)
                this.flags |= FL_GODMODE;
 
        if(autocvar_bot_god)
                this.flags |= FL_GODMODE;
 
-       this.bot_nextthink = max(time, this.bot_nextthink) + max(0.01, autocvar_bot_ai_thinkinterval * pow(0.5, this.bot_aiskill) * min(14 / (skill + 14), 1));
+       this.bot_nextthink = max(time, this.bot_nextthink) + max(0.01, autocvar_bot_ai_thinkinterval * (0.5 ** this.bot_aiskill) * min(14 / (skill + 14), 1));
 
        //if (this.bot_painintensity > 0)
        //      this.bot_painintensity = this.bot_painintensity - (skill + 1) * 40 * frametime;
 
        //if (this.bot_painintensity > 0)
        //      this.bot_painintensity = this.bot_painintensity - (skill + 1) * 40 * frametime;
index acb7e86bd8b9d02605eb5c11e0445365c8616445..7a1d6a501da872f14d93f07cbd24165864ac2b83 100644 (file)
@@ -475,7 +475,7 @@ void havocbot_movetogoal(entity this)
                        dxy = this.origin - ( ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5 ); dxy.z = 0;
                        d = vlen(dxy);
                        v = vlen(this.velocity -  this.velocity.z * '0 0 1');
                        dxy = this.origin - ( ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5 ); dxy.z = 0;
                        d = vlen(dxy);
                        v = vlen(this.velocity -  this.velocity.z * '0 0 1');
-                       db = (pow(v,2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100;
+                       db = ((v ** 2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100;
                //      dprint("distance ", ftos(ceil(d)), " velocity ", ftos(ceil(v)), " brake at ", ftos(ceil(db)), "\n");
                        if(d < db || d < 500)
                        {
                //      dprint("distance ", ftos(ceil(d)), " velocity ", ftos(ceil(v)), " brake at ", ftos(ceil(db)), "\n");
                        if(d < db || d < 500)
                        {
@@ -1147,7 +1147,7 @@ void havocbot_chooseweapon(entity this, .entity weaponentity)
                this.lastcombotime = time;
        }
 
                this.lastcombotime = time;
        }
 
-       distance *= pow(2, this.bot_rangepreference);
+       distance *= (2 ** this.bot_rangepreference);
 
        // Custom weapon list based on distance to the enemy
        if(bot_custom_weapon){
 
        // Custom weapon list based on distance to the enemy
        if(bot_custom_weapon){
index 1531cde98db39e08cff0b494f89dc259d3566a17..7f6e17f5e4c53ea85eea0fa9eb259fe8af3919f5 100644 (file)
@@ -889,7 +889,7 @@ float bot_cmd_keypress_handler(entity this, string key, float enabled)
        {
                case "all":
                        if(enabled)
        {
                case "all":
                        if(enabled)
-                               this.bot_cmd_keys = power2of(20) - 1; // >:)
+                               this.bot_cmd_keys = (2 ** 20) - 1; // >:)
                        else
                                this.bot_cmd_keys = BOT_CMD_KEY_NONE;
                case "forward":
                        else
                                this.bot_cmd_keys = BOT_CMD_KEY_NONE;
                case "forward":
index e6dc964fe893a0c08a58351a61877b91bce030c1..ded5e8409885efa1500d13237e5b2b2921bdab45 100644 (file)
@@ -882,7 +882,7 @@ void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
        dragger.dragdistance = vlen(touchpoint - dragger.origin - dragger.view_ofs);
        dragger.draglocalangle = draggee.angles.y - dragger.v_angle.y;
        touchpoint = touchpoint - gettaginfo(draggee, 0);
        dragger.dragdistance = vlen(touchpoint - dragger.origin - dragger.view_ofs);
        dragger.draglocalangle = draggee.angles.y - dragger.v_angle.y;
        touchpoint = touchpoint - gettaginfo(draggee, 0);
-       tagscale = pow(vlen(v_forward), -2);
+       tagscale = (vlen(v_forward) ** -2);
        dragger.draglocalvector_x = touchpoint * v_forward * tagscale;
        dragger.draglocalvector_y = touchpoint * v_right * tagscale;
        dragger.draglocalvector_z = touchpoint * v_up * tagscale;
        dragger.draglocalvector_x = touchpoint * v_forward * tagscale;
        dragger.draglocalvector_y = touchpoint * v_right * tagscale;
        dragger.draglocalvector_z = touchpoint * v_up * tagscale;
@@ -964,7 +964,7 @@ void Drag_MoveForward(entity dragger)
 
 void Drag_SetSpeed(entity dragger, float s)
 {
 
 void Drag_SetSpeed(entity dragger, float s)
 {
-       dragger.dragspeed = pow(2, s);
+       dragger.dragspeed = (2 ** s);
 }
 
 void Drag_MoveBackward(entity dragger)
 }
 
 void Drag_MoveBackward(entity dragger)
index 259857ccd4d8908ac760219154568660ce81fa92..11c339b4d647a07a5df4884dba8e16761bb4dcee 100644 (file)
@@ -1029,7 +1029,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                                        LOG_INFOF("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f);
 
 
                                                        LOG_INFOF("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f);
 
 
-                                               total = 0.25 * pow(max(mininv_f, mininv_d), 2);
+                                               total = 0.25 * (max(mininv_f, mininv_d) ** 2);
 
                                                if(autocvar_g_throughfloor_debug)
                                                        LOG_INFOF(" steps=%f", total);
 
                                                if(autocvar_g_throughfloor_debug)
                                                        LOG_INFOF(" steps=%f", total);
index 6e40fcba7766d6d8f1178e4b60164989566dc519..6a6cdc214e7504da31dafb31d3ddf9406f73c987 100644 (file)
@@ -1141,7 +1141,7 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling
                string newlist;
 
                // now reinsert this at another position
                string newlist;
 
                // now reinsert this at another position
-               insertpos = pow(random(), 1 / exponent);       // ]0, 1]
+               insertpos = (random() ** 1 / exponent);       // ]0, 1]
                insertpos = insertpos * (Map_Count - 1);       // ]0, Map_Count - 1]
                insertpos = ceil(insertpos) + 1;               // {2, 3, 4, ..., Map_Count}
                LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos));
                insertpos = insertpos * (Map_Count - 1);       // ]0, Map_Count - 1]
                insertpos = ceil(insertpos) + 1;               // {2, 3, 4, ..., Map_Count}
                LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos));
index 14457679f15c2ab98ba0319046b751d775eb1dd7..e91a7c219df52b9411280841ad22a995b477fee0 100644 (file)
@@ -1313,7 +1313,7 @@ void attach_sameorigin(entity e, entity to, string tag)
     float tagscale;
 
     org = e.origin - gettaginfo(to, gettagindex(to, tag));
     float tagscale;
 
     org = e.origin - gettaginfo(to, gettagindex(to, tag));
-    tagscale = pow(vlen(v_forward), -2); // undo a scale on the tag
+    tagscale = (vlen(v_forward) ** -2); // undo a scale on the tag
     t_forward = v_forward * tagscale;
     t_left = v_right * -tagscale;
     t_up = v_up * tagscale;
     t_forward = v_forward * tagscale;
     t_left = v_right * -tagscale;
     t_up = v_up * tagscale;
index 5f3bd4b39597fff8371f165f8cfa2edecc77d92d..0c3d27be4e9c10cf10d7ea41af20832bd414121d 100644 (file)
@@ -130,7 +130,7 @@ void kh_update_state()
                        f = key.team;
                else
                        f = 30;
                        f = key.team;
                else
                        f = 30;
-               s |= pow(32, key.count) * f;
+               s |= (32 ** key.count) * f;
        }
 
        FOREACH_CLIENT(true, LAMBDA(it.kh_state = s));
        }
 
        FOREACH_CLIENT(true, LAMBDA(it.kh_state = s));
@@ -138,7 +138,7 @@ void kh_update_state()
        FOR_EACH_KH_KEY(key)
        {
                if(key.owner)
        FOR_EACH_KH_KEY(key)
        {
                if(key.owner)
-                       key.owner.kh_state |= pow(32, key.count) * 31;
+                       key.owner.kh_state |= (32 ** key.count) * 31;
        }
        //print(ftos((nextent(NULL)).kh_state), "\n");
 }
        }
        //print(ftos((nextent(NULL)).kh_state), "\n");
 }
@@ -858,7 +858,7 @@ int kh_GetMissingTeams()
                                ++players;
                ));
                if (!players)
                                ++players;
                ));
                if (!players)
-                       missing_teams |= pow(2, i);
+                       missing_teams |= (2 ** i);
        }
        return missing_teams;
 }
        }
        return missing_teams;
 }
index eace0ee5995b0b20d42417c20a6dd860105c18d0..c0ebfc54a6335da48be50c0798035412cd1cf797 100644 (file)
@@ -118,7 +118,7 @@ float TeamScore_AddToTeam(float t, float scorefield, float score)
        }
        if(score)
                if(teamscores_label(scorefield) != "")
        }
        if(score)
                if(teamscores_label(scorefield) != "")
-                       s.SendFlags |= pow(2, scorefield);
+                       s.SendFlags |= (2 ** scorefield);
        return (s.(teamscores(scorefield)) += score);
 }
 
        return (s.(teamscores(scorefield)) += score);
 }
 
@@ -265,7 +265,7 @@ float PlayerScore_Clear(entity player)
        FOREACH(Scores, true, {
                if(sk.(scores(it)) != 0)
                        if(scores_label(it) != "")
        FOREACH(Scores, true, {
                if(sk.(scores(it)) != 0)
                        if(scores_label(it) != "")
-                               sk.SendFlags |= pow(2, i % 16);
+                               sk.SendFlags |= (2 ** (i % 16));
                sk.(scores(it)) = 0;
        });
 
                sk.(scores(it)) = 0;
        });
 
@@ -282,7 +282,7 @@ void Score_ClearAll()
                FOREACH(Scores, true, {
                        if(sk.(scores(it)) != 0)
                                if(scores_label(it) != "")
                FOREACH(Scores, true, {
                        if(sk.(scores(it)) != 0)
                                if(scores_label(it) != "")
-                                       sk.SendFlags |= pow(2, i % 16);
+                                       sk.SendFlags |= (2 ** (i % 16));
                        sk.(scores(it)) = 0;
                });
        });
                        sk.(scores(it)) = 0;
                });
        });
@@ -295,7 +295,7 @@ void Score_ClearAll()
                {
                        if(sk.(teamscores(j)) != 0)
                                if(teamscores_label(j) != "")
                {
                        if(sk.(teamscores(j)) != 0)
                                if(teamscores_label(j) != "")
-                                       sk.SendFlags |= pow(2, j);
+                                       sk.SendFlags |= (2 ** j);
                        sk.(teamscores(j)) = 0;
                }
        }
                        sk.(teamscores(j)) = 0;
                }
        }
@@ -339,7 +339,7 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
        }
        if(score)
                if(scores_label(scorefield) != "")
        }
        if(score)
                if(scores_label(scorefield) != "")
-                       s.SendFlags |= pow(2, scorefield.m_id % 16);
+                       s.SendFlags |= (2 ** (scorefield.m_id % 16));
        if(!warmup_stage)
                PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
        return (s.(scores(scorefield)) += score);
        if(!warmup_stage)
                PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
        return (s.(scores(scorefield)) += score);
index 517bc1892ca8541c77f8b35d4bb9c969c6d6cd7a..84819efbe1c6b51f407c9e9e9b509dcd82aab441 100644 (file)
@@ -318,7 +318,7 @@ entity Spawn_WeightedPoint(entity firstspot, float lower, float upper, float exp
 
        RandomSelection_Init();
        for(spot = firstspot; spot; spot = spot.chain)
 
        RandomSelection_Init();
        for(spot = firstspot; spot; spot = spot.chain)
-               RandomSelection_AddEnt(spot, pow(bound(lower, spot.spawnpoint_score.y, upper), exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x);
+               RandomSelection_AddEnt(spot, (bound(lower, spot.spawnpoint_score.y, upper) ** exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x);
 
        return RandomSelection_chosen_ent;
 }
 
        return RandomSelection_chosen_ent;
 }