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

Integer Overflow in Addition #3

Open
pnu-edward opened this issue May 10, 2022 · 0 comments
Open

Integer Overflow in Addition #3

pnu-edward opened this issue May 10, 2022 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@pnu-edward
Copy link
Owner

pnu-edward commented May 10, 2022

Describe the bug
두 정수의 계산 범위가 int 타입의 표현 범위를 초과하는 경우 계산 결과가 틀리게 출력됩니다.

To Reproduce

  1. 프로그램을 실행합니다.
  2. 입력으로 2000000000 2000000000 입력합니다.
  3. 실행 결과는 2000000000 + 2000000000 = -294967296 으로 틀린 계산 결과가 발생합니다.
$ build/calc
$ 2000000000 2000000000
$ 2000000000 + 2000000000 = -294967296

Expected behavior

기대하는 출력 결과는 2000000000 + 2000000000 = 4000000000 입니다.

Screenshots

Desktop (please complete the following information):

  • OS: 32~18.04.1-Ubuntu SMP
  • Version: v0.1

Smartphone (please complete the following information):

Additional context
Add any other context about the problem here.

@pnu-edward pnu-edward added the bug Something isn't working label May 10, 2022
@pnu-edward pnu-edward added this to the v0.2 milestone May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant