]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
some bit fiddling
authorRudolf Polzer <divverent@xonotic.org>
Tue, 18 Oct 2011 14:11:03 +0000 (16:11 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 18 Oct 2011 14:11:03 +0000 (16:11 +0200)
qcsrc/common/util.qc

index c3407757a469c8d3e3dbb56d03bac34d2dd85816..d97ec0918be53a64e3d55e00e296b6f5c0b31032 100644 (file)
@@ -2085,3 +2085,13 @@ float xdecode(string s)
                return -1;
        return ((a * 22 + b) * 22 + c) * 22 + d;
 }
+
+float lowestbit(float f)
+{
+       f &~= f * 2;
+       f &~= f * 4;
+       f &~= f * 16;
+       f &~= f * 256;
+       f &~= f * 65536;
+       return f;
+}