[GHC] #8702: floor, ceiling, truncate and so on… on NaN fail

GHC ghc-devs at haskell.org
Sun Jan 26 18:51:57 UTC 2014


#8702: floor, ceiling, truncate and so on… on NaN fail
-------------------------+-------------------------------------------------
       Reporter:         |             Owner:
  skypers                |            Status:  new
           Type:  bug    |         Milestone:  _|_
       Priority:  high   |           Version:  7.4.1
      Component:         |  Operating System:  Linux
  libraries/base         |   Type of failure:  Incorrect result at runtime
       Keywords:         |         Test Case:  let nan = 0 / 0 in floor nan
   Architecture:         |          Blocking:
  x86_64 (amd64)         |
     Difficulty:         |
  Unknown                |
     Blocked By:         |
Related Tickets:         |
-------------------------+-------------------------------------------------
 Those functions returns a total random value when given NaN. This is not
 an acceptable behavior I guess, and we might inquire on what to do.

 For instance:


 {{{
 let nan = 0 / 0 in floor nan
 }}}

 result:

 {{{
 -269653970229347386159395778618353710042696546841345985910145121736599013708251444699062715983611304031680170819807090036488184653221624933739271145959211186566651840137298227914453329401869141179179624428127508653257226023513694322210869665811240855745025766026879447359920868907719574457253034494436336205824
 }}}

 Maybe an arithmetic exception would be a better behavior?

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


More information about the ghc-tickets mailing list