1 Jun
2007
1 Jun
'07
4:35 a.m.
Jon Fairbairn wrote:
"David House" <dmhouse@gmail.com> writes:
On 31/05/07, Andrew Coppin <andrewcoppin@btinternet.com> wrote:
If you're bored... can you come up with a solution to this?
Try using floatToDigits: http://haskell.org/ghc/docs/latest/html/libraries/base/Numeric.html#v%3Afloa...
"floatToDigits takes a base and a non-negative RealFloat number, and returns a list of digits and an exponent."
I think you also need floatRadix and floatDigits.
Note that the challenge asks for the "internal" bitmap representation of an IEEE double-precision integer - not the mathematical binary expansion. (In particular, things like Infinity and NaN have special bit sequences.) Did I mention that this is a silly challange yet?