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

feat: check dbl_min_max on Decimal.new method #207

Merged
merged 5 commits into from
Feb 11, 2025

Conversation

karlosmid
Copy link
Contributor

Copy link
Owner

@ericmj ericmj left a comment

Choose a reason for hiding this comment

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

This check should be on to_float/1 as we still want to be able to represent larger decimal numbers for everything other than float conversion.

lib/decimal.ex Outdated

def dbl_min(sign), do: %Decimal{sign: sign, coef: 22_250_738_585_072_014, exp: -324}
def zero(sign), do: %Decimal{sign: sign, coef: 0, exp: 0}
def dbl_max(sign), do: %Decimal{sign: sign, coef: 17_976_931_348_623_158, exp: 292}
Copy link
Owner

Choose a reason for hiding this comment

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

Let's not add these functions to the public API.

@ericmj ericmj requested a review from wojtekmach May 15, 2024 12:22
@wojtekmach wojtekmach merged commit 8843f5b into ericmj:main Feb 11, 2025
2 checks passed
@wojtekmach
Copy link
Collaborator

Thank you, apologies for the delay merging this!

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.

3 participants