Closed itshawk closed 3 years ago
def event_to_analog_value(event: ControlEntry): val = int32((event.flags << 16) | event.enabled) val <<= int32(8) val >>= int32(8) return -val
What is the purpose of the bitwise shifts in this function?
I wrote this algorithm for donadigo. These shifts are arithmetic and not logical. They convert non-standard 24bit signed integer into usable 32bit signed integer.
What is the purpose of the bitwise shifts in this function?