Posted By

aflatter on 02/03/09


Tagged

decimal binary conversion convert haskell


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

keigoi


Convert binary to decimal in Haskell


 / Published in: Other
 

  1. binToDec l = sum $ map (2^) $ findIndices (==1) $ reverse l

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: aflatter on February 3, 2009

usage: binToDec [1,0,1,0] => 10

You need to login to post a comment.