[GHC] #3304: define gcd 0 0 = 0

GHC cvs-ghc at haskell.org
Sun Jun 12 22:42:25 CEST 2011


#3304: define gcd 0 0 = 0
-----------------------------+----------------------------------------------
  Reporter:  stevec          |          Owner:                  
      Type:  proposal        |         Status:  closed          
  Priority:  normal          |      Milestone:  7.2.1           
 Component:  libraries/base  |        Version:  7.1             
Resolution:  fixed           |       Keywords:                  
  Testcase:                  |      Blockedby:                  
Difficulty:  Unknown         |             Os:  Unknown/Multiple
  Blocking:                  |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown    |  
-----------------------------+----------------------------------------------

Comment(by daniel.is.fischer):

 I thought so, too, for a while, but when I tried that, I ran into gcd
 minBound (-1), which throws the overflowError, so unfortunately we have to
 call abs on the arguments (or go via Integer for all types).

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



More information about the Glasgow-haskell-bugs mailing list