Monday, February 21, 2005

Lossy conversion between decimal to binary

Suppose you have random decimal data, for example decimal digits of pi, and you want random bits. Take 28 digits at a time and get 93 bits out (2^93 = 0.99035e28), rejecting if the value is too large.

For the other direction, take 196 bits at a time and get 59 digits out. 2^196=1.004336e59.

No comments :