X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Fbits.qh;h=de11eef412154af108c93b92d6dd5c1768b84ea3;hb=fc6a7642cb0a75c7ae7e69701b8615d03dfa269e;hp=c158ea032d497cb29a8709c2e02ad4fa8e2bd610;hpb=fdbfb6f9364d8aeae67e108400a6bd1dd37dc0b7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/bits.qh b/qcsrc/lib/bits.qh index c158ea032..de11eef41 100644 --- a/qcsrc/lib/bits.qh +++ b/qcsrc/lib/bits.qh @@ -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