-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/나눗셈 기능 추가 완료 #11
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
base: team-1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| def div(a, b): | ||
| try: | ||
| # 1. 입력받은 문자열을 숫자로 변환 | ||
| n1 = float(a) | ||
| n2 = float(b) | ||
|
|
||
| # 2. 0으로 나누기 체크 | ||
| if n2 == 0: | ||
| return " 0으로 나눌 수 없습니다." | ||
|
|
||
| # 3. 계산 및 소수점 오차 보정 (10자리) | ||
| result = n1 / n2 | ||
| return round(result, 10) | ||
|
|
||
| except ValueError: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The input-validation path only catches Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분에 대해서 질문드리고 싶은게 있습니다. 우선 Chat GPT PR 리뷰를 사용해주신 접근은 매우 좋다고 생각이 듭니다. AI 리뷰를 사용하신 이유와 리뷰 달아주신 내용을 보고 어떤 부분에 대한 리뷰를 달아줬는지 확인 하시고 이해를 하셨을지 궁금합니다. 요약하자면 지금 코드는 ValueError만 잡고 있고 float()은 TypeError도 발생하고 있다고 TypeError도
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ValueError는 타입은 맞지만 값이 잘못됐을떄 입력이 항상 문자열이 올거라고 가정하고 작성하여 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 지금은 충분히 단순 계산기 기능 구현이기에 ValueError 부분만 고려하셨을 것이라 생각이 듭니다. 그러나 추후에 규모 있는 프로젝트 진행 시에는 TypeError에 대한 부분도 같이 생각해보면서 코드를 구현하실 수 있는 좋은 경험이 되셨으면 좋겠습니다! 😊 |
||
| # 숫자가 아닌 값이 입력되었을 경우 예외 처리 | ||
| return "숫자만 입력 가능합니다." | ||
|
|
||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
먼저, 이 부분에 대해서 민구님에게 질문 드리고 싶은 부분이 있습니다.
지금 주석 달아주신 부분인 "계산 및 소수점 오차 보정 (10자리)" 이 의미가 제가 이해한 내용으로는 나눗셈 결과를
소수점 10자리까지 반올림해서 반환해주는 의미로 저는 이해를 했습니다.
우선 제가 이해한 부분을 바탕으로 질문을 드리자면 10자리까지 남기고 반올림을 하시는 의도가 무엇인지 궁금합니다. 우선 float을 통해서 숫자를 받고 나누는 과정에서 소수점이 10자리가 넘어가는 경우가 당연히 존재할 것이라고 생각합니다. 현재 다른 PR 올린 내용에서 곱셈을 예시로 들면 소수점 3번째 자리까지 받게끔 코드가 작성되어 있는데 10자리까지 결과가 나오면 나눗셈만 왜 10자리까지 나오지? 하고 의문이 들 것 같다고 예상합니다. 혹시 이 의도가 있는지 궁금합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float의 노이즈 방지로 10자리로 잡았었습니다.
-> 8자리 or 9자리등 다른 것도 가능한데 10자리로 잡은 이유는 어림잡아 잡았던거 같습니다.
소수점 몇번쨰까지 통일하자라는 것은 팀원 분들과 소통하지 못한것 같습니다
사용자 입장에서 소숫점 자리가 다르면 시각적으로 불편 뿐만 아니라 의문을 가질 거라는 것 이해 할 수 있었습니다 . (여기 까지 생각하지 못하였습니다.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
협업에서 가장 중요한 점은 팀원들과의 소통을 통해서 합의된 결과를 도출해가는 과정이 중요하다고 생각합니다. 지금 코드가 문제가 되는 코드는 아니지만, 이러한 부분에서 팀원과의 소통을 통해서 합의된 결과를 도출해서 정하는 과정을 배우셨으면 좋을 것 같아서 질문 드렸던 내용이었습니다!