Aesthetikx / bits-required

a little experiment with various programming languages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bits required?

How many bits do we need to represent values up to x? For example, to represent values up to 10, we need 4 bits. To represent up to 169, we need 9 bits.

I wanted to try implementing this in various programming languages as an exercise. The program reads a number from the command line (in argv) and prints the number of required bits; that's it!

About

a little experiment with various programming languages

License:The Unlicense


Languages

Language:Go 36.2%Language:Scala 16.2%Language:Python 15.6%Language:JavaScript 12.7%Language:CoffeeScript 12.3%Language:Ruby 7.0%