From: Martin DeMello Date: 2006-12-03T05:54:35+09:00 Subject: Re: convert binary array to floating point decimal On 12/3/06, Martin DeMello wrote: > > Ruby has a built in method for converting a binary string into an > integer, so your code is simply > > def binaryStringToFloat(str) > str.to_i(2) * 1.0/str.length > end that should be str.to_i(2) * 1.0/(1 << str.length) of course martin