Skip to content

Conversation

@bishabosha
Copy link
Member

fixes #7419

The given instance in FromDigits for BigDecimal was incorrectly ignoring exponents in number literals.

The given instance in FromDigits for BigDecimal was incorrectly ignoring exponents in number literals,
This commit instead allows exponents in BigDecimal literals, and adds a test.
@bishabosha bishabosha requested a review from smarter October 13, 2019 22:04
@bishabosha bishabosha changed the title Make BigDecimalFromDigits FromDigits.Floating[BigDecimal] Make BigDecimalFromDigits extend FromDigits.Floating Oct 13, 2019
}

given BigDecimalFromDigits : FromDigits.Decimal[BigDecimal] {
given BigDecimalFromDigits : FromDigits.Floating[BigDecimal] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like the correct fix, but then in which case would you actually use FromDigits.Decimal ? It seems like it's not really useful on its own /cc @odersky

Copy link
Member Author

@bishabosha bishabosha Oct 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if there is no sparse representation for the implementation then it could make sense, but it's simple to convert from an exponent anyway.

@bishabosha bishabosha merged commit 174de92 into scala:master Oct 15, 2019
@bishabosha bishabosha deleted the bigdec_fromFloating branch October 15, 2019 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigDecimalFromDigits unused for generic literals with exponents

2 participants