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

calc: Set maximum digit length to 9 #35

Merged
merged 1 commit into from
Aug 22, 2024
Merged

calc: Set maximum digit length to 9 #35

merged 1 commit into from
Aug 22, 2024

Conversation

Bennctu
Copy link
Collaborator

@Bennctu Bennctu commented Aug 22, 2024

According to #25, we find that the input number is random if the digits of the number is larger than 9 digits.
The type of calc->stack[0] is int, and the maximum value for an int is 2,147,483,647. Conservatively, we ensure that when the length reaches 9 digits, pressing the digit button will not increase the number of digits.

Screen Recording 2024-08-22 151523

Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Append Close #25 at the end of git commit message, so that that issue will be closed once the commit is merged.

See https://github.blog/news-insights/product-news/closing-issues-via-commit-messages/

@jserv jserv changed the title Set maximum digit length to 9 calc: Set maximum digit length to 9 Aug 22, 2024
apps/calc.c Outdated Show resolved Hide resolved
The type of calc->stack[0] is int,
and the maximum value for an int is 2,147,483,647.
Conservatively, we ensure that when the length reaches 9 digits,
pressing the digit button will not increase the number of digits.
Close sysprog21#25
@jserv jserv merged commit fd3e451 into sysprog21:main Aug 22, 2024
3 checks passed
@jserv
Copy link
Contributor

jserv commented Aug 22, 2024

Thank @Bennctu for contributing. I amended the git commit message. See https://cbea.ms/git-commit/ for improving.

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.

2 participants