This does not handle decimals and is untested. John Hughes wrote a great article on how to derive these functions a while back, but I don't remember the name/url. > toBase x base = if (x<base) then [convert x] else (convert digit):(toBase rem base) > where convert x = toEnum (x+ascii_0) > digit = x - rem > rem = x `div` base > ascii_0=48 On Mon, 19 Apr 1999, CC600800 wrote: > Can anyone help me write a function to convert a decimal number into > its binary equivalent? > Much appreciated. > > JF > ___________________________________________________________________ S. Alexander Jacobson Shop.Com 1-212-697-0184 voice The Easiest Way To Shop
Re: How do you convert a number to binary?
S. Alexander Jacobson Tue, 20 Apr 1999 14:13:26 -0400 (Eastern Daylight Time)