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. --- src/library/scala/math/BigDecimal.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/library') 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) -- cgit v1.2.3