[GHC] #11553: `round (± ∞ :: Double)` not infinite

#11553: `round (± ∞ :: Double)` not infinite -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: | Version: libraries/base | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Rounding 1/0 or 0/0 results in an arbitrary chosen `Integer` value, e.g. {{{ λ:2> (round (1/0 :: Double) :: Integer) == 2^1024 True λ:3> (round (-1/0 :: Double) :: Integer) == -(2^1024) True }}} I'm not sure if this is more desirable than returning a bottom value (e.g. by throwing some `ArithException`) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11553 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11553: `round (± ∞ :: Double)` not infinite -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by hvr: @@ -1,1 +1,1 @@ - Rounding 1/0 or 0/0 results in an arbitrary chosen `Integer` value, e.g. + Rounding 1/0 or -1/0 results in an arbitrary chosen `Integer` value, e.g. @@ -9,0 +9,3 @@ + + λ:4> (round (0/0 :: Double) :: Integer) == -(2^1024 + 2^1023) + True New description: Rounding 1/0 or -1/0 results in an arbitrary chosen `Integer` value, e.g. {{{ λ:2> (round (1/0 :: Double) :: Integer) == 2^1024 True λ:3> (round (-1/0 :: Double) :: Integer) == -(2^1024) True λ:4> (round (0/0 :: Double) :: Integer) == -(2^1024 + 2^1023) True }}} I'm not sure if this is more desirable than returning a bottom value (e.g. by throwing some `ArithException`) -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11553#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC