[GHC] #8823: showFloat for higher precision types produces strange results for some values

GHC ghc-devs at haskell.org
Tue Feb 25 14:02:16 UTC 2014


#8823: showFloat for higher precision types produces strange results for some
values
------------------------------------------------+--------------------------
        Reporter:  axman6                       |            Owner:
            Type:  bug                          |           Status:  closed
        Priority:  low                          |        Milestone:
       Component:  Prelude                      |          Version:
      Resolution:  invalid                      |  7.8.1-rc1
Operating System:  Unknown/Multiple             |         Keywords:
 Type of failure:  Incorrect result at runtime  |     Architecture:
       Test Case:                               |  Unknown/Multiple
        Blocking:                               |       Difficulty:
                                                |  Unknown
                                                |       Blocked By:
                                                |  Related Tickets:
------------------------------------------------+--------------------------
Changes (by rwbarton):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Your `RealFloat` instance is invalid. See the documentation for
 `decodeFloat`:

 >  If decodeFloat x yields (m,n), then x is equal in value to m*b^n^,
 where b is the floating-point radix, and furthermore, either m and n are
 both zero or else '''b^(d-1)^ <= abs m < b^d^, where d is the value of
 floatDigits x'''.

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


More information about the ghc-tickets mailing list