Skip to content

Commit

Permalink
address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kiszk committed Apr 20, 2017
1 parent 9a15ba2 commit 655e115
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ final class Decimal extends Ordered[Decimal] with Serializable {
}

/**
* Set this Decimal to the given BigInteger value. Will have precision 38 and scale 0.
* Set this Decimal to the given BigInteger value. Will have precision 38 and scale 0
* if value is fit into long value range. Otherwise, use BigDecimal
*
* This code avoids BigDecimal object allocation as possible to improve runtime efficiency
*/
def set(bigintval: BigInteger): Decimal = {
try {
Expand All @@ -144,7 +147,6 @@ final class Decimal extends Ordered[Decimal] with Serializable {
} catch {
case _: ArithmeticException =>
set(BigDecimal(bigintval))
this
}
}

Expand Down

0 comments on commit 655e115

Please sign in to comment.