[GHC] #8695: Arithmetic overflow from (minBound :: Int) `quot` (-1)
GHC
ghc-devs at haskell.org
Tue Jan 28 22:38:00 UTC 2014
#8695: Arithmetic overflow from (minBound :: Int) `quot` (-1)
------------------------------------------------+--------------------------
Reporter: rleslie | Owner:
Type: bug | Status: patch
Priority: normal | Milestone: 7.8.1
Component: libraries/haskell2010 | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect result at runtime | Unknown/Multiple
Test Case: | Difficulty:
Blocking: | Unknown
| Blocked By:
| Related Tickets: #1042
------------------------------------------------+--------------------------
Comment (by carter):
relevant to this discussion, heres the relevant paragraph in H2010 report
section 6.4
http://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1350006.4
The standard numeric types are listed in Table 6.1. The finite-precision
integer type Int covers at least the range [ − 229, 229 − 1]. As Int
is an instance of the Bounded class, maxBound and minBound can be used to
determine the exact Int range defined by an implementation. Float is
implementation-defined; it is desirable that this type be at least equal
in range and precision to the IEEE single-precision type. Similarly,
Double should cover IEEE double-precision. The results of exceptional
conditions (such as overflow or underflow) on the fixed-precision numeric
types are undefined; an implementation may choose error (⊥, semantically),
a truncated value, or a special value such as infinity, indefinite, etc.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8695#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list