[GHC] #10754: truncate /= double2Int

GHC ghc-devs at haskell.org
Sat Aug 8 08:33:26 UTC 2015


#10754: truncate /= double2Int
-------------------------------------+-------------------------------------
        Reporter:  cblp              |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  libraries/base    |                 Version:  7.10.2
      Resolution:                    |                Keywords:  truncate,
                                     |  double2Int, rewrite, rule
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by bgamari):

 One could even argue here that neither answer is in fact correct in light
 of the description of `truncate`,
 > `truncate x` returns the integer nearest `x` between zero and `x`

 In this case `truncate infinity` should be `maxBound :: Int`, no?

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


More information about the ghc-tickets mailing list