Difference between revisions of "$not"

From Scriptwiki
Jump to: navigation, search
 
(Only one parameter, compared against max value.)
 
Line 1: Line 1:
Performs a bit-wise NOT comparison against two numbers
+
Performs a bit-wise NOT comparison between 4294967295 and the given number.
  $not(number 1, number 2)
+
  $not(number)
  
 
==Something to Consider==
 
==Something to Consider==
 
mIRC deals with all numbers as DWORDs (4-byte integers with a max value of 11111111111111111111111111111111 or 4294967295 in decimal).
 
mIRC deals with all numbers as DWORDs (4-byte integers with a max value of 11111111111111111111111111111111 or 4294967295 in decimal).
Therefore, when performing a not, take into consideration all of the "0"s that may be before your number.
+
Therefore the number which the given integer is compared against will be the max value, and the given number will always have 32 bits.
  
 
==Examples==
 
==Examples==
  $not(4294967294,4294967295)
+
  $not(5)
  
 
Binary values of each:
 
Binary values of each:
  11111111111111111111111111111101
+
  11111111111111111111111111111111
  11111111111111111111111111111110
+
  00000000000000000000000000000101
  
Leaving the bits which are '''NOT''' in 4294967294 but are in 4294967295
+
Leaving the bits which are in 4294967295 but '''NOT''' in 5
  
  Returns: 2 (00000000000000000000000000000010)
+
  Returns: 4294967290 (11111111111111111111111111111010)
 
[[Category:Bitwise Identifiers]]
 
[[Category:Bitwise Identifiers]]

Latest revision as of 21:03, 9 May 2008

Performs a bit-wise NOT comparison between 4294967295 and the given number.

$not(number)

Something to Consider

mIRC deals with all numbers as DWORDs (4-byte integers with a max value of 11111111111111111111111111111111 or 4294967295 in decimal). Therefore the number which the given integer is compared against will be the max value, and the given number will always have 32 bits.

Examples

$not(5)

Binary values of each:

11111111111111111111111111111111
00000000000000000000000000000101

Leaving the bits which are in 4294967295 but NOT in 5

Returns: 4294967290 (11111111111111111111111111111010)