diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-06-18 09:02:10 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-06-18 09:02:10 +0200 |
commit | c4f0ba4c108132e9e289032b99c519e0a0b7b056 (patch) | |
tree | 989ebfc259217502cb5f2deec4228dbac83e4267 /src | |
parent | 23bfa691e2c7372f52958912ff7dbf1cadc1a50c (diff) | |
parent | 5ab401084141d37c03dc29c9028917b92e56ca68 (diff) | |
download | scala-c4f0ba4c108132e9e289032b99c519e0a0b7b056.tar.gz scala-c4f0ba4c108132e9e289032b99c519e0a0b7b056.tar.bz2 scala-c4f0ba4c108132e9e289032b99c519e0a0b7b056.zip |
Merge pull request #4527 from nicky-zs/fix_BigDecimal
fix BigDecimal losing MathContext
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/math/BigDecimal.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/math/BigDecimal.scala b/src/library/scala/math/BigDecimal.scala index d6e2963ad8..6bb35606a6 100644 --- a/src/library/scala/math/BigDecimal.scala +++ b/src/library/scala/math/BigDecimal.scala @@ -49,7 +49,7 @@ object BigDecimal { /** Constructs a `BigDecimal` using the decimal text representation of `Double` value `d`, rounding if necessary. */ def decimal(d: Double, mc: MathContext): BigDecimal = - new BigDecimal(new BigDec(java.lang.Double.toString(d), mc)) + new BigDecimal(new BigDec(java.lang.Double.toString(d), mc), mc) /** Constructs a `BigDecimal` using the decimal text representation of `Double` value `d`. */ def decimal(d: Double): BigDecimal = decimal(d, defaultMathContext) @@ -59,7 +59,7 @@ object BigDecimal { * `0.1 != 0.1f`. */ def decimal(f: Float, mc: MathContext): BigDecimal = - new BigDecimal(new BigDec(java.lang.Float.toString(f), mc)) + new BigDecimal(new BigDec(java.lang.Float.toString(f), mc), mc) /** Constructs a `BigDecimal` using the decimal text representation of `Float` value `f`. * Note that `BigDecimal.decimal(0.1f) != 0.1f` since equality agrees with the `Double` representation, and |