flipbits!

..  flipbits!(B::BitArray{N}) -> BitArray{N}

Performs a bitwise not operation on ``B``. See :ref:`~ operator <~>`.

Examples

The flipbits! function in Julia performs a bitwise not operation on a BitArray and modifies it in-place.

julia> bits = BitArray([true, false, true, false]);
julia> flipbits!(bits)
4-element BitArray{1}:
 false
  true
 false
  true

This example flips the bits of the BitArray bits using the flipbits! function.

Here is another example:

julia> bits = BitArray([false, false, true, true]);
julia> flipbits!(bits)
4-element BitArray{1}:
  true
  true
 false
 false

It flips the bits of the BitArray bits in-place.

Note: The flipbits! function works only with BitArray objects.

See Also

bitpack, bitunpack, bswap, flipbits!, htol, hton, isbits, ltoh, ntoh, rol, rol!, ror, ror!, signbit,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: