summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-03-23 07:59:18 +0000
committerPaul Phillips <paulp@improving.org>2011-03-23 07:59:18 +0000
commit8ca5a8fbbc592f944797162a0f10a02741ea7b36 (patch)
tree65a40727850d45c7ba0fbd04d09060f0261c6207 /src/library
parent413feab04ce1afe05b3bd60c084f5c5c3ad8ba4a (diff)
downloadscala-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 'src/library')
-rw-r--r--src/library/scala/math/BigDecimal.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/math/BigDecimal.scala b/src/library/scala/math/BigDecimal.scala
index 9c1c4f45a9..684769bef1 100644
--- a/src/library/scala/math/BigDecimal.scala
+++ b/src/library/scala/math/BigDecimal.scala
@@ -23,7 +23,7 @@ import annotation.migration
object BigDecimal {
private val minCached = -512
private val maxCached = 512
- val defaultMathContext = MathContext.UNLIMITED
+ val defaultMathContext = MathContext.DECIMAL128
@deprecated("Use Long.MinValue")
val MinLong = new BigDecimal(BigDec valueOf Long.MinValue, defaultMathContext)