From 8ca5a8fbbc592f944797162a0f10a02741ea7b36 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 23 Mar 2011 07:59:18 +0000 Subject: My early attempts to implement non-integral ran... My early attempts to implement non-integral ranges in a way which was useful without having lots of floating point traps were less than successful. One of the bigger backfires is that the requirement not to round (trying, and failing anyway, to avoid surprises with methods like "contains") inflicts runtime errors. The simple way to improve this, which seems a good idea anyway, is to make the default math context something less inclined to exceptions. Default BigDecimal mc is now DECIMAL128. References #1812, #4201 and puts #4201 back to normal priority. Review by community. --- test/files/run/bug4201.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test/files/run/bug4201.scala (limited to 'test') diff --git a/test/files/run/bug4201.scala b/test/files/run/bug4201.scala new file mode 100644 index 0000000000..f6c0acaf94 --- /dev/null +++ b/test/files/run/bug4201.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + val f = 0.0 to 1.0 by 1.0 / 3.0 + assert(f.size == 4) + } +} + -- cgit v1.2.3