[GHC] #12611: expression calculation error

#12611: expression calculation error ----------------------------------------+---------------------------- Reporter: Tom | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Windows Architecture: Unknown/Multiple | Type of failure: Other Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+---------------------------- Prelude> 20^65-exp(65*log(20)) 6.211571712111507e70 Obviously, correct result is 0. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12611 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12611: expression calculation error -----------------------------+---------------------------------------- Reporter: Tom | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Description changed by Tom: @@ -2,0 +2,1 @@ + New description: Prelude> 20^65-exp(65*log(20)) 6.211571712111507e70 Obviously, correct result is 0. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12611#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12611: expression calculation error -----------------------------+---------------------------------------- Reporter: Tom | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Description changed by Tom: @@ -1,1 +1,1 @@ - Prelude> 20^65-exp(65*log(20)) + Prelude> 20^{65}-exp(65*log(20)) New description: Prelude> 20^{65}-exp(65*log(20)) 6.211571712111507e70 Obviously, correct result is 0. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12611#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12611: expression calculation error -----------------------------+---------------------------------------- Reporter: Tom | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------+---------------------------------------- Changes (by hsyl20): * status: new => closed * resolution: => invalid Comment: This is a precision issue with Double numbers: {{{
2^21-exp(21*log(2)) :: Double 0.0 2^22-exp(22*log(2)) :: Double -9.313225746154785e-10 2^22 :: Double 4194304.0 exp(22*log(2)) :: Double 4194304.000000001 }}}
You get the same result with other languages: {{{ php > echo (20**65 - exp(65*log(20))) ; 6.1252998827766E+70 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12611#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC