Function bnot()

← Back to Module core



Module core → bnot()

Description

Perform bitwise NOT operation for the given number x. Every bit of x will be inverted

bnot(x, bit_width = 32, unsigned = false)


Parameters


Return Value


Usage Example

a = bnot(0)               ' a = -1  -> Where the negation of 00000000000000000000000000000000 is 11111111111111111111111111111111 (-1 in signed 32-bit)
b = bnot(0, 8, true)      ' b = 255 -> Where the negation of 00000000 is 11111111 (255 in unsigned 8-bit)
c = bnot(0x0f, 8, true)   ' c = 240 -> Where the negation of 00001111 is 11110000 (240 in unsigned 8-bit)


Availability

This function is available on Dinfio version 3.1.06 or later