Code Monkey home page Code Monkey logo

bit-twiddling-hacks's Introduction

BitOperations

License GPLv3 AppVeyor build status Travis build status Coveralls coverage

Several bit operations and manipulations, also known as 'bit hacks'.

Please note that the coverage results do not include the function macros, although those are tested in the unit tests.

Documentation

Documentation can be found in the documentation page, and for the function macros and functions on the BitOperations.h documentation page.
For the functions that are based on Sean Eron Anderson's Bit Twiddling Hacks the arithmetics are explained on Joe Gibson's markdown version of Sean Eron Anderson's Bit Twiddling Hacks.

Usage

In order to use this code the only thing that you need to do is copy BitOperations.h and BitOperations.c to your project and include BitOperations.h in the files where you intend to use the BitOperations. These two files can be found in every release in the source and source/src folders respectively.

Unit test

The unit tests use greatest by Scott Vokes. Greatest is licensed under a custom license.
The purpose of this unit test is not to verify that the arithmetic is correct, because Sean Eron Anderson already tested that thoroughly. This unit test verifies that the implementation is correct.

All the functions and function macros are tested by the unit tests, of which the log can be found in every travis build or in every AppVeyor build.

Licensing

GNU General Public License version 3 or later, as published by the Free Software Foundation. Modification and redistribution are permitted according to the terms of the GPL. The license can be found in the LICENSE file.

Pull requests and bug reports/suggestions are welcome!

bit-twiddling-hacks's People

Contributors

jdbruijn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.