BitNot: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Server client function}} {{Needs_Example}} __NOTOC__ {{New feature/item|3.0140|1.4|5285| This function performs a bitwise NOT on an (unsigned) 32-bit integer. See [http...")
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Server client function}}
{{Server client function}}
{{Needs_Example}}
__NOTOC__
__NOTOC__
{{New feature/item|3.0140|1.4|5285|
{{New feature/item|3.0132|1.3.2|5340|
This function performs a bitwise NOT on an (unsigned) 32-bit [[Int|integer]]. See [http://en.wikipedia.org/wiki/Bitwise_operation#NOT Bitwise operation] for more details.
This function performs a bitwise NOT on an (unsigned) 32-bit [[Int|integer]]. See [http://en.wikipedia.org/wiki/Bitwise_operation#NOT Bitwise operation] for more details.
}}
}}
Line 18: Line 17:


==Example==
==Example==
<section name="server" class="server" show="true">
--In this example we make a command which you can do a bitNot operator
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
ToDo
function bitnot(thePlayer,cmd,value)
 
    outputChatBox(bitNot(value),thePlayer)
 
end
 
addCommandHandler("bitnot",bitnotFunc)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Bit_functions}}
{{Bit_functions}}

Latest revision as of 20:06, 4 May 2015

This function performs a bitwise NOT on an (unsigned) 32-bit integer. See Bitwise operation for more details.

Syntax

uint bitNot ( uint var )

Required arguments

  • var: The value you want to perform a bitwise NOT on

Returns

Returns the value on which the operation has been performed.

Example

Click to collapse [-]
server

--In this example we make a command which you can do a bitNot operator

function bitnot(thePlayer,cmd,value)

    outputChatBox(bitNot(value),thePlayer)

end

addCommandHandler("bitnot",bitnotFunc)

See Also