Skip to content
Enumerate masked numbers
C++ Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml
COPYING
Makefile
Readme.md
main.cpp
mask_enum.cpp
mask_enum.hpp

Readme.md

Mask enumerator

Enumerate masked numbers

Travis CI status

Features

Operates in range of 32bits, eg. 0~0xFFFFFFFF

Example

Suppose we have a value 27000 and a mask 0xfff8 (the 3 bits counting from LSB is being masked out)

Run the program as follow:

$ ./mask_enum 27000 0xfff8

The program enumerates all the numbers starting from 27000 and is covered/masked by the mask 0xfff8.

The result is: [27000, 27007]. Program output as below:

value: 27000, mask: 0xfff8

Results:
27000
27001
27002
27003
27004
27005
27006
27007

Compiler Requirements

C++

License

This program is licensed under zlib License

Notes

This program was created to verify the solution of Mask calculator

You can’t perform that action at this time.