Skip to content

Instantly share code, notes, and snippets.

@Heegiiny
Created April 11, 2018 12:22
Show Gist options
  • Select an option

  • Save Heegiiny/7a97a075bbcd6643a25c74471bf575c4 to your computer and use it in GitHub Desktop.

Select an option

Save Heegiiny/7a97a075bbcd6643a25c74471bf575c4 to your computer and use it in GitHub Desktop.

Revisions

  1. Heegiiny created this gist Apr 11, 2018.
    12 changes: 12 additions & 0 deletions flip9bits.cpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    uint16_t flip9bits(uint16_t in)
    {
    uint16_t out;

    for (int i = 0; i < 9; i++) {
    out <<= 1;
    out |= in & 1;
    in >>= 1;
    }

    return out;
    }