- Joined
- Dec 12, 2008
- Messages
- 7,385
This snippet is used to do the Bitwise NOT operation. It takes one byte, meaning you have to input a number in the range [0x00 ... 0xff].
Feel free to comment.
Or not. This thing is too simple for that.
JASS:
/***************************
*
* ByteNot
* v1.1.0.1
* By Magtheridon96
*
* - Used to perform the bitwise NOT
* operation for 8 bits. (1 byte)
*
* API:
* ----
*
* function B_NOT takes integer byte returns integer
* - Returns (~byte)
* - The argument must be in the range [0x00 ... 0xff]
*
***************************/
library ByteNot
constant function B_NOT takes integer byte returns integer
return 0xff - byte
endfunction
endlibrary
JASS:
/***************************
*
* Not32
* v1.0.0.1
* By Magtheridon96
*
* - Used to perform the bitwise NOT
* operation for integers. (32-bits)
*
* API:
* ----
*
* function NOT32 takes integer int returns integer
* - Returns (~int)
*
***************************/
library Not32
constant function NOT32 takes integer int returns integer
return -int - 1
endfunction
endlibrary
Feel free to comment.
Or not. This thing is too simple for that.
Last edited: