Skip to content

Dev#24

Closed
khn23 wants to merge 12 commits intoinmo-jang:mainfrom
khn23:dev
Closed

Dev#24
khn23 wants to merge 12 commits intoinmo-jang:mainfrom
khn23:dev

Conversation

@khn23
Copy link

@khn23 khn23 commented May 24, 2025

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🎯 Core Changes

  • Added three new mathematical functions: power, multiply, and avg to the functions.py module.

⚠️ Concerns

  • The new functions lack input validation, which could lead to runtime errors if non-numeric types are passed as arguments.

Verdict: Comment


Code review performed by OPENAI - gpt-4o-mini.


def avg(a, b):
"""Average of a and b"""
return (a + b) / 2

Choose a reason for hiding this comment

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

Consider adding input validation to ensure that both 'a' and 'b' are numeric types before performing operations.


def multiply(a, b):
"""Multiply a and b"""
return a * b

Choose a reason for hiding this comment

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

The 'multiply' function could benefit from a docstring that specifies the expected types of 'a' and 'b'.


def power(a, b):
"""Power a by b"""
return a ** b

Choose a reason for hiding this comment

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

The 'power' function should clarify in its docstring that it raises 'a' to the power of 'b', and specify the expected types.


def avg(a, b):
"""Average of a and b"""
return (a + b) / 2

Choose a reason for hiding this comment

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

The 'avg' function's docstring should mention that it returns a float, as the result of the division may not always be an integer.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🎯 Core Changes

  • Added a new function gcd to compute the greatest common divisor of two numbers.

⚠️ Concerns

  • The new gcd function lacks input validation, which could lead to runtime errors if non-integer types are passed as arguments.
  • The existing functions still do not have input validation, which remains a concern from previous reviews.

Verdict: Comment


Code review performed by OPENAI - gpt-4o-mini.

return (a + b) / 2

def gcd(a, b):
while b: # b가 0이 될 때까지 a와 b를 나누며 반복

Choose a reason for hiding this comment

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

Consider adding input validation to ensure that both 'a' and 'b' are integers before performing operations in the 'gcd' function.


def avg(a, b):
"""Average of a and b"""
return (a + b) / 2

Choose a reason for hiding this comment

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

Consider adding input validation to ensure that both 'a' and 'b' are numeric types before performing operations in the 'avg' function.


def multiply(a, b):
"""Multiply a and b"""
return a * b

Choose a reason for hiding this comment

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

The 'multiply' function could benefit from a docstring that specifies the expected types of 'a' and 'b'.


def power(a, b):
"""Power a by b"""
return a ** b

Choose a reason for hiding this comment

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

The 'power' function should clarify in its docstring that it raises 'a' to the power of 'b', and specify the expected types.


def avg(a, b):
"""Average of a and b"""
return (a + b) / 2

Choose a reason for hiding this comment

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

The 'avg' function's docstring should mention that it returns a float, as the result of the division may not always be an integer.

@khn23 khn23 closed this May 25, 2025
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