advanced code snippet search
aflatter on 02/03/09
decimal binary conversion convert haskell
1 person have marked this snippet as a favorite
binToDec l = sum $ map (2^) $ findIndices (==1) $ reverse l
Report this snippet
usage: binToDec [1,0,1,0] => 10
You need to login to post a comment.