]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
warn about bit ops 630/head
authorMartin Taibr <taibr.martin@gmail.com>
Tue, 15 Jan 2019 01:56:03 +0000 (02:56 +0100)
committerMartin Taibr <taibr.martin@gmail.com>
Tue, 15 Jan 2019 01:56:49 +0000 (02:56 +0100)
qcsrc/lib/bits.qh

index c158ea032d497cb29a8709c2e02ad4fa8e2bd610..de11eef412154af108c93b92d6dd5c1768b84ea3 100644 (file)
@@ -2,6 +2,9 @@
 
 #include "log.qh"
 
+/// Only ever assign into the first 24 bits in QC (so max is BIT(23)).
+/// QC converts the float to int, performs the bit operation, then converts it back.
+/// Assigning to the highest bits means some of the low ones might get lost due to float precision.
 #define BIT(n) (1 << (n))
 #define BITS(n) (BIT(n) - 1)
 #ifndef BRANCHLESS_BITSET