[Haskell-cafe] Re: Just for a laugh...

2007-05-31 Thread Jon Fairbairn
"David House" <[EMAIL PROTECTED]> writes: > On 31/05/07, Andrew Coppin <[EMAIL PROTECTED]> 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%3AfloatToDigits > > "floatToDigit

[Haskell-cafe] Re: Just for a laugh...

2007-05-31 Thread Jon Fairbairn
Andrew Coppin <[EMAIL PROTECTED]> writes: > Jon Fairbairn wrote: > > "David House" <[EMAIL PROTECTED]> writes: > > > > > >> On 31/05/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: > >> > >>> If you're bored... can you come up with a solution to this? > >>> > >> Try using floatToDigits: > >> http://h

[Haskell-cafe] Re: Just for a laugh...

2007-06-01 Thread Jon Fairbairn
"Dougal Stanton" <[EMAIL PROTECTED]> writes: > On 31 May 2007 21:52:33 +0100, > Jon Fairbairn <[EMAIL PROTECTED]> wrote: > > Yes, but you didn't say that it's not only silly but > > demonstrates the opposite of expressiveness as it's all > > about breaking an abstraction and must be non-portable >

Re: [Haskell-cafe] Re: Just for a laugh...

2007-05-31 Thread Andrew Coppin
Jon Fairbairn wrote: "David House" <[EMAIL PROTECTED]> writes: On 31/05/07, Andrew Coppin <[EMAIL PROTECTED]> 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

Re: [Haskell-cafe] Re: Just for a laugh...

2007-05-31 Thread David House
On 31/05/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: 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.) Ah, sorry, then disr

Re: [Haskell-cafe] Re: Just for a laugh...

2007-05-31 Thread Dougal Stanton
On 31 May 2007 21:52:33 +0100, Jon Fairbairn <[EMAIL PROTECTED]> wrote: Yes, but you didn't say that it's not only silly but demonstrates the opposite of expressiveness as it's all about breaking an abstraction and must be non-portable code (because it's definition is that it won't give the same

Re: [Haskell-cafe] Re: Just for a laugh...

2007-06-02 Thread Udo Stenzel
Andrew Coppin wrote: > Note that the challenge asks for the "internal" bitmap representation of > an IEEE double-precision integer Actually it didn't. It asked for the machine's internal representation of a double precision float, and you are not guaranteed that this representation conforms to I

Re: [Haskell-cafe] Re: Just for a laugh...

2007-06-03 Thread Rafael Almeida
The site seems to be asking for the internal floating point representation. So it doesn't matter if it's IEEE 754, if the ints are 2-complements, or whatever. I used this code as a quick hack for one of my programs, but I think it would work in this case. It should work for any Storable type. im

Re: [Haskell-cafe] Re: Just for a laugh...

2007-06-03 Thread Rafael Almeida
On 6/3/07, Rafael Almeida <[EMAIL PROTECTED]> wrote: The site seems to be asking for the internal floating point representation. So it doesn't matter if it's IEEE 754, if the ints are 2-complements, or whatever. I used this code as a quick hack for one of my programs, but I think it would work i

Re: [Haskell-cafe] Re: Just for a laugh...

2007-06-03 Thread Donald Bruce Stewart
almeidaraf: > On 6/3/07, Rafael Almeida <[EMAIL PROTECTED]> wrote: > >The site seems to be asking for the internal floating point > >representation. So it doesn't matter if it's IEEE 754, if the ints are > >2-complements, or whatever. I used this code as a quick hack for one of > >my programs, but