Skip to content

Finding zero digits in powers of two.

License

Notifications You must be signed in to change notification settings

TimoWilken/zeros-in-powers-of-two

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finding zeros in digits of powers of two

I wrote the Haskell version first, then the C version for speed.

Both programs take an optional command-line argument, the power of two to start from (e.g. zeros 10 starts from 1024).

Try it in C

$ gcc -O2 zeros.c -lgmp -o zeros
$ ./zeros

Try it in Haskell

$ ghc -O2 -dynamic -o zeros.haskell zeros.hs
$ ./zeros.haskell

Releases

No releases published

Packages

No packages published