On Wed, Apr 03, 2002 at 11:15:04AM -0800, Hal Daume III wrote:
> I'm looking for a (not-necessarily Haskell 98 compliant, as long as it
> works in GHC) way to get at the internal representation of Doubles. I can
> use decodeDouble# to get at it, but I need something equivalent to
> encodeDouble#
On Wed, 3 Apr 2002, Hal Daume III wrote:
> I found one way:
>
> doubleToInts d = runST (
> do arr <- newDoubleArray (1,2)
>writeDoubleArray arr 1 d
>i1 <- readIntArray arr 1
>i2 <- readIntArray arr 2
>return (i1,i2))
>
> intsToDouble (i1,i2) = runST (
> do
I found one way:
doubleToInts d = runST (
do arr <- newDoubleArray (1,2)
writeDoubleArray arr 1 d
i1 <- readIntArray arr 1
i2 <- readIntArray arr 2
return (i1,i2))
intsToDouble (i1,i2) = runST (
do arr <- newDoubleArray (1,2)
writeIntArray arr 1 i1
I'm looking for a (not-necessarily Haskell 98 compliant, as long as it
works in GHC) way to get at the internal representation of Doubles. I can
use decodeDouble# to get at it, but I need something equivalent to
encodeDouble# to go the other way, and I cannot find such a function
anywhere. Any s