diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-23 07:59:18 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-23 07:59:18 +0000 |
commit | 8ca5a8fbbc592f944797162a0f10a02741ea7b36 (patch) | |
tree | 65a40727850d45c7ba0fbd04d09060f0261c6207 /test/files/run | |
parent | 413feab04ce1afe05b3bd60c084f5c5c3ad8ba4a (diff) | |
download | scala-8ca5a8fbbc592f944797162a0f10a02741ea7b36.tar.gz scala-8ca5a8fbbc592f944797162a0f10a02741ea7b36.tar.bz2 scala-8ca5a8fbbc592f944797162a0f10a02741ea7b36.zip |
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.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/bug4201.scala | 7 |
1 files changed, 7 insertions, 0 deletions
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) + } +} + |