Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | HaleyHalcyon |
I have this code that converts four 8-bit integers into one 32-bit integer with big-endian encoding:
var score_to_beat = data[1] << 24 + data[2] << 16 + data[3] << 8 + data[4]
However, when I try to do that with all the integers set to 255, Godot gave me this error:
Invalid operands 'int' and 'int' in operator '<<'.
Isn’t the bit shift operator supposed to take two integers? What’s the real problem here?