[GHC] #3070: floor(0/0) should not be defined

GHC trac at galois.com
Thu Jul 16 05:01:38 EDT 2009


#3070: floor(0/0) should not be defined
---------------------------------+------------------------------------------
    Reporter:  carette           |        Owner:  squadette       
        Type:  bug               |       Status:  new             
    Priority:  normal            |    Milestone:  6.12.1          
   Component:  Prelude           |      Version:  6.10.1          
    Severity:  normal            |   Resolution:                  
    Keywords:                    |   Difficulty:  Unknown         
    Testcase:                    |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
---------------------------------+------------------------------------------
Comment (by squadette):

 or, the problem is purely of expectations.

 People are used to the fact that evaluating 0/0 gives Division by zero
 runtime error.

 Haskell however is so lazy that it does not bother exiting.   Maybe a
 special command line argument is needed -- terminate on invalid FP
 operations.  This could be useful for beginners, gentle introductions and
 such.

 As for the day-to-day programming we just declare that Double cannot be
 converted to integral types anyway, so a) invalid operations give NaN, and
 b) all the functions will give you literal garbage when out of the target
 range (incl. NaN and Infinity).

 AFAIU floating point developers are used to manage evaluation details
 carefully  anyway.

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


More information about the Glasgow-haskell-bugs mailing list