Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quoted.Liftable[BigInt] and quoted.Liftable[BigDecimal] to the stdlib #6944

Merged
merged 5 commits into from Jul 27, 2019

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki changed the title Add quoted.Liftable[BigInt] to the stdlib Add quoted.Liftable[BigInt] and quoted.Liftable[BigDecimal] to the stdlib Jul 27, 2019
liufengyun
liufengyun previously approved these changes Jul 27, 2019
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

library/src/scala/quoted/Liftable.scala Show resolved Hide resolved
@plokhotnyuk
Copy link

plokhotnyuk commented Jul 27, 2019

@nicolasstucki is it can be done only through string representation?

Have you considered to use Array[Byte] for BigInt and (Array[Byte] /* mantissa */, Int /* scale */, java.math.MathContext /* mc */) for BigDecimal instead?

Conversion through the string can be inefficient for really big numbers or lead for some unexpected rounding...

@nicolasstucki
Copy link
Contributor Author

I did consider the Array[Byte] variant, but I left it as an optimization for later as I still do not have the liftable for Array[Byte]. But I can add the generic version and add the specialised one afterwards.

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@nicolasstucki nicolasstucki merged commit 3181374 into scala:master Jul 27, 2019
@nicolasstucki nicolasstucki deleted the add-bignumbers-liftable branch July 27, 2019 15:29
@anatoliykmetyuk anatoliykmetyuk added this to the 0.18 Tech Preview milestone Aug 28, 2019
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.

None yet

4 participants