FUNCTION REFERENCE

bitcmp

Bitwise complement.

Bitwise complement.

Syntax

c = bitcmp(a)

Syntax

c = bitcmp(a, assumedtype)

Flips the bits of integer a in assumedtype (default 'uint64'). Accepted names

are 'uint8', 'uint16', 'uint32', 'uint64', 'int8', 'int16', 'int32', and 'int64'.

Inputs must fit the type and have absolute value at most 2^53. Results are

rounded to double. For the default type this is 2^64 - 1 - a.

Example

bitcmp(0)   % 18446744073709551616 (2^64 after rounding)

Integer input uses its own storage width and returns the same class without rounding.

Example

bitcmp(uint8(0))   % uint8(255)

Differences from MATLAB: Typed integer input takes one argument; no bit-count argument.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.