Bit32.bnot

From GiderosMobile
Revision as of 19:47, 22 January 2023 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2022.3<br/> '''Class:''' bit32<br/> === Description === Returns the bitwise ''negation'' of x. <source lang="lua"> (number) = bit...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2022.3
Class: bit32

Description

Returns the bitwise negation of x.

(number) = bit32.bnot(x)

For any integer x, the following identity holds:

assert(bit32.bnot(x) == (-1 - x) % 2^32)

Parameters

x: (number) value

Return values

Returns (number) result

See also

Bitwise Operators