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 numeric constants. #1515

Merged
merged 4 commits into from
May 11, 2022
Merged

Add numeric constants. #1515

merged 4 commits into from
May 11, 2022

Conversation

adlerjohn
Copy link
Contributor

@adlerjohn adlerjohn commented May 10, 2022

Add numeric associated constants (like https://doc.rust-lang.org/std/primitive.u64.html#associatedconstant.MAX).

To avoid being blocked by #610, uses function.

@adlerjohn adlerjohn added enhancement New feature or request lib: std Standard library labels May 10, 2022
@adlerjohn adlerjohn self-assigned this May 10, 2022
@adlerjohn adlerjohn marked this pull request as ready for review May 11, 2022 17:49
@Braqzen
Copy link
Contributor

Braqzen commented May 11, 2022

I'm wondering if it makes more sense to have this code live in lib-core/ops.sw. Thoughts?

@adlerjohn
Copy link
Contributor Author

adlerjohn commented May 11, 2022

Oh you're actually correct, not sure why I put it in std.

@adlerjohn adlerjohn marked this pull request as draft May 11, 2022 19:18
sway-lib-std/src/num.sw Outdated Show resolved Hide resolved
@adlerjohn adlerjohn added lib: core Core library and removed lib: std Standard library labels May 11, 2022
@adlerjohn adlerjohn marked this pull request as ready for review May 11, 2022 21:38
@adlerjohn
Copy link
Contributor Author

Ready for review @Braqzen @otrho

@adlerjohn adlerjohn requested a review from nfurfaro May 11, 2022 21:38
Copy link
Contributor

@nfurfaro nfurfaro left a comment

Choose a reason for hiding this comment

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

LGTM!

@otrho
Copy link
Contributor

otrho commented May 11, 2022

In C++ this file is called limits. num is fine though. 🙂

@adlerjohn adlerjohn merged commit 9f90748 into master May 11, 2022
@adlerjohn adlerjohn deleted the adlerjohn/int-constants branch May 11, 2022 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lib: core Core library
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants