
#14377: some results not expected with the addition -------------------------------------+------------------------------------- Reporter: vanto | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: invalid | 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: | -------------------------------------+------------------------------------- Comment (by svenpanne): Replying to [comment:7 vanto]:
It has nothing to do with what you say otherwise why other languages give correct results and not GHC? [...]
Within `Double`'s precision, all the results are correct. They might not be ''minimal'' in the sense that they output the minimum number of characters necessary, but they are nevertheless correct: The Haskell Report doesn't require minimality AFAICT. If we wanted such minimality, this would be a feature request, not a bug report. One would have to make detailed performance measurements for such a change: It's easy to get more than an order of magnitude slower here, which might be a deal-breaker for lots of people. I propose you google for "What Every Computer Scientist Should Know About Floating-Point Arithmetic" and/or have a look at the papers and blogs mentioned in the previous Stack Exchange link. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14377#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler