thesteelydane
Bunker Samples
I’ve seen a bit (pun intended) of code that used bit operations to make sure a value didn’t exceed a certain threshold, basically using sh_right(value,31) and some math.
I can accomplish the same with a simple If statement:
So why use sh_right instead? Said piece of code was being called inside a busy listener callback, but is it really that much more efficient than an if statement?
I can accomplish the same with a simple If statement:
Code:
if (value >= threshold)
value := threshold
end if
So why use sh_right instead? Said piece of code was being called inside a busy listener callback, but is it really that much more efficient than an if statement?
Last edited: