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

Implement Symbol.toPrimitive to solve issues with lexographical comparison #186

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Implement Symbol.toPrimitive to solve issues with lexographical comparison #186

wants to merge 1 commit into from

Conversation

francisrstokes
Copy link

This PR implements the Symbol.toPrimitive method, which provides a strategy to convert a decimal to a number when comparisons like less than, greater than, etc.

This PR should close #172.

@francisrstokes francisrstokes marked this pull request as draft October 8, 2021 09:31
@francisrstokes
Copy link
Author

This fix breaks some other tests - some of which are likely easy to accommodate for and some might need some more investigation. This PR is mostly to get the discussion started for allowing sane comparisons of Decimals.

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.

Using comparison operators with Decimals can give the wrong result
1 participant