Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - not() perform bitwise negation http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 not()               Perform bitwise negation
------------------------------------------------------------------------------
 Declaration
   bit.hdr

 Syntax
   func uint not extern
   param value uint uNumber

 Arguments
   uNumber is the numeric to operate on.

 Return
   The result of the negation.

 Description
   The not() function performs a bitwise negation on the given number, i.e.
   all bits set to 1 will be set to 0 and vice versa.

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_not
   /* decimal representation   binary representation
   
           248                          11111000
           NOT                          --------
             7                  Result: 00000111
   */
   
   ? not( 248UI )                 // prints 65287
   ? lobyte( not( 248UI ) )       // prints     7
   ?
   ? not(         11111000B )     // prints 65287
   ? not( 0000000011111000B )     // prints 65287
   ? not( 1111111111111000B )     // prints     7
   ?
   ? not( 1111111111111110B )     // prints     1
   ? not( 1111111111111101B )     // prints     2
   endproc

   proc main
   Test_not()
   endproc

See Also: and() or() xor()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson