-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bit shifting in skript #140
Comments
Do you have a use case for this? More often than not, bit shifts are used to manipulate bitmasks, which skript-mirror's bits expression already lets you do and in a much more readable way. |
Well I wanted to do something like that :
Do you know how I can make something like that with the bit expression (I don't really understand the expression well.... :/) |
Please take a look at the docs for the bits expression. |
Already seen it but I'm lost 🤔 |
The bits expression is not a bit shift. The entire purpose of the expression is to prevent the user from even having to think about bit shifting. Example: |
%numbers%'[s] (bit %number%|1¦bit(s| range) [from] %number%( to |[ ]-[ ])%number%) |
Is your feature request related to a problem? Please describe.
So its the second time since I start using skript-mirror (I started not long ago) that I need to use bit shifting for an algorithme (>> in java)
Ex : 4>>2 = 1
Complete explanation here : https://stackoverflow.com/questions/141525/what-are-bitwise-shift-bit-shift-operators-and-how-do-they-work
Describe the solution you'd like
an expression like %object%>>%number% that return the value of the object after the shifting...
Describe alternatives you've considered
Some peoples says that:
A>>3 is equal to divise something by 8 (2 * 2 * 2)
A<<5 is equal to multiple something by 32 (2 * 2 * 2 * 2 * 2)
But this is not the exact same things, bit shifting when shifting too far remove bit, see more here
The text was updated successfully, but these errors were encountered: