244 captures
21 Feb 2009 - 07 Feb 2026
Sep OCT Nov
22
2019 2020 2021
success
fail

About this capture

COLLECTED BY

Collection: Common Crawl

Web crawl data from Common Crawl.
TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20201022210653/https://bits.stephan-brumme.com/
 

What's This Web Site About ?

 Before saying anything else, let's declare the legal stuff:  I collected all these little helpful pieces of code on the internet.
 I, STEPHAN BRUMME, DIDN'T ORIGINALLY INVENT THEM.
 However, the authors put them into the public domain, which is absolutely great.
 
Do whatever you want with the code, it's okay for commercial stuff, too.
 Let's call it "tellware" - if you find it useful, tell all your colleagues about it.
 
By far the best web sites on the subject, and my inspiration,  are The Aggregate from the University of Kentucky and  "Bit Twiddling Hacks" by Sean Eron Anderson.  Spend a minute or two and check out both !
 
Each bit twiddler trick is accompanied by full C code including a validation routine which proves correctness for all inputs.  Nevertheless, if you find a bug, don't hesitate to contact me (see bottom of each page).
 
I give performance ratings for my own computer and I'm very keen on timings of different  CPU architectures / compilers. Just download the sources and run them.

All The Twiddled Bits



(I)Absolute value of a float

(II)Absolute value of an integer

(III)Approximative inverse of a float

(IV)Bit manipulation basics

(V)Bit mask of lowest bit not set

(VI)Count bits set in parallel a.k.a. Population Count

(VII)Detects zero bytes inside a 32 bit integer

(VIII)Endianess

(IX)Extend bit width

(X)Float inverse square root approximation

(XI)Float square root approximation

(XII)Is power of two

(XIII)Minimum / maximum of integers

(XIV)Parity

(XV)Position of lowest bit set

(XVI)Round up to the next power of two

(XVII)Sign comparison

(XVIII)Sign of a 32 bit integer

(XIX)Swap two values
 

Interactive


Javascript Bit Manipulator  


several names used on this site are registered trademarks of their respective owners.
 
I did not invent all of the code  please take a look at the references.
 thanks to all the originators for sharing their ideas !
 
for more information about me, Stephan Brumme, visit my web site
 
bugs ? feedback ? send an email to bits at stephanbrumme dot com!