[GHC] #4092: Floating point manipulation : ulp and coerce IEEE-754 Double# into Word64#

GHC cvs-ghc at haskell.org
Tue May 25 06:13:09 EDT 2010


#4092: Floating point manipulation : ulp and coerce IEEE-754 Double# into Word64#
---------------------------------+------------------------------------------
    Reporter:  malosh            |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:  6.14.1      
   Component:  Compiler          |      Version:  6.12.2      
    Keywords:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Testcase:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------
Changes (by simonmar):

  * milestone:  => 6.14.1


Comment:

 What I had in mind was something like:

 {{{
 coerceDoubleToWord64# :: Double# -> Word64#
 coerceFloatToWord32#  :: Float#  -> Word#
 }}}

 (note we don't have a Word32# type)

 By the way, you can do this without the FFI right now,  by poking the
 `Double` into memory, and then peeking it out as a `Word64`.  Not terribly
 efficient, but better than using the FFI.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4092#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list