From 0f5aec39e3b5906bdf63647fae185218e0c83011 Mon Sep 17 00:00:00 2001 From: Martin Taibr Date: Tue, 15 Jan 2019 02:56:03 +0100 Subject: [PATCH] warn about bit ops --- qcsrc/lib/bits.qh | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.2