[project @ 2000-06-12 19:57:40 by panne]
authorpanne <unknown>
Mon, 12 Jun 2000 19:57:40 +0000 (19:57 +0000)
committerpanne <unknown>
Mon, 12 Jun 2000 19:57:40 +0000 (19:57 +0000)
Print only the first 6 characters of the result's decimal
representation, this "solves" the problem that without optimization
0.46920002 was printed and 0.4692 with -O. Perhaps this could be
turned into a test for constant folding, but this was probably not the
test writer's intention.

ghc/tests/codeGen/should_run/cg018.hs

index b230b00..02220c8 100644 (file)
@@ -3,7 +3,9 @@
 import PrelGHC( Float# )
 import PrelFloat
 
-main = putStr (shows (selectee1 + selectee2) "\n")
+-- This test is a little bit numerically unstable, so compare only a small prefix.
+-- Otherwise you get slightly different results with and without optimization.
+main = putStrLn (take 6 (shows (selectee1 + selectee2) ""))
 
 data Tfo = Tfo Float# Float# Float# Float# Float# Float# Float# Float# Float# Float# Float# Float#