[GHC] #3676: realToFrac doesn't sanely convert between floating types

GHC ghc-devs at haskell.org
Thu Apr 14 01:37:19 UTC 2016


#3676: realToFrac doesn't sanely convert between floating types
-------------------------------------+-------------------------------------
        Reporter:  draconx           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  ⊥
       Component:  Core Libraries    |              Version:  6.12.1
      Resolution:                    |             Keywords:  report-impact
Operating System:  Unknown/Multiple  |         Architecture:  x86_64
                                     |  (amd64)
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by Rufflewind):

 * cc: ekmett (added)


Comment:

 I think it would be a useful to at least note this problem in the docs for
 `realToFrac`:

 {{{
 -- | general coercion to fractional types
 --
 --   Warning: avoid using this function to convert between floating-point
 --   number types. Consider using 'GHC.Float.float2Double' and
 --   'GHC.Float.double2Float' instead.  See
 --   <https://ghc.haskell.org/trac/ghc/ticket/3676 GHC bug #3676>.
 }}}

 (Incidentally, the documentation for `GHC.Float` is hidden from the
 users.)

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


More information about the ghc-tickets mailing list