[GHC] #8695: Arithmetic overflow from (minBound :: Int) `quot` (-1)

GHC ghc-devs at haskell.org
Tue Jun 2 23:12:40 UTC 2015


#8695: Arithmetic overflow from (minBound :: Int) `quot` (-1)
-------------------------------------+-------------------------------------
        Reporter:  rleslie           |                   Owner:
            Type:  feature request   |                  Status:  closed
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Core Libraries    |                 Version:  7.6.3
      Resolution:  wontfix           |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #1042             |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 I believe the correct statements would be

 * The Bounded, Enum, Integral, Ord, Real and Show type class methods treat
 Int as a subset of Integer.

 * The Num and Read type class methods treat Int as a quotient of Integer
 ("mod 2^n^"), except that signum treats Int as a subset of Integer, and
 abs is in a funny in-between state. Basically it is only the ring
 operations (addition, subtraction, multiplication, and hence conversion
 from Integer) that are performed using modular arithmetic.

 * (For Eq, it doesn't matter whether you consider Int to be a subset or a
 quotient of Integer.)

 Not sure where to put all this, though.

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


More information about the ghc-tickets mailing list