From: Martin Taibr Date: Tue, 15 Jan 2019 01:56:03 +0000 (+0100) Subject: warn about bit ops X-Git-Tag: xonotic-v0.8.5~1639^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0f5aec39e3b5906bdf63647fae185218e0c83011;p=xonotic%2Fxonotic-data.pk3dir.git warn about bit ops --- 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