summaryrefslogtreecommitdiff
path: root/test/files/pos/FPTest.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-01 20:31:12 +0000
committerPaul Phillips <paulp@improving.org>2010-11-01 20:31:12 +0000
commitae4910485511c12cda0c110b6563610041070b5d (patch)
treef915e03b7143908008a510e9852a0ebe1962786c /test/files/pos/FPTest.scala
parentc0b74d9bcdf3e9d4601b6057dd8ddfd556ef757c (diff)
downloadscala-ae4910485511c12cda0c110b6563610041070b5d.tar.gz
scala-ae4910485511c12cda0c110b6563610041070b5d.tar.bz2
scala-ae4910485511c12cda0c110b6563610041070b5d.zip
Created @strictfp annotation in scala.annotation.
your fp with no tolerance for tomfoolery, this is the commit for you. Closes #1708, review by community.
Diffstat (limited to 'test/files/pos/FPTest.scala')
-rw-r--r--test/files/pos/FPTest.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/pos/FPTest.scala b/test/files/pos/FPTest.scala
new file mode 100644
index 0000000000..b351b7bb9c
--- /dev/null
+++ b/test/files/pos/FPTest.scala
@@ -0,0 +1,11 @@
+// On some hypothetical future day when we can test the emitted bytecode,
+// should look for the fp bit. Until then, just a pos test.
+import annotation.strictfp
+
+@strictfp class FPTest {
+ def main(args: Array[String]): Unit = {
+ val d: Double = 8e+307
+ println(4.0 * d * 0.5);
+ println(2.0 * d);
+ }
+}