/ Published in: Other
Expand |
Embed | Plain Text
binToDec l = sum $ map (2^) $ findIndices (==1) $ reverse l
Comments
Subscribe to comments
You need to login to post a comment.
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
Subscribe to comments
You need to login to post a comment.
usage: binToDec [1,0,1,0] => 10