Skip to content

feat: add fibonacci function with edge case handling - #15

Open
pgupta1262002 wants to merge 2 commits into
gougousongsong:mainfrom
pgupta1262002:fix/fibonacci-function-edge-cases
Open

feat: add fibonacci function with edge case handling#15
pgupta1262002 wants to merge 2 commits into
gougousongsong:mainfrom
pgupta1262002:fix/fibonacci-function-edge-cases

Conversation

@pgupta1262002

Copy link
Copy Markdown

Implementation Summary

  • Added fibonacci(n: int) -> int to src/math_utils.py.
  • 0-indexed Fibonacci calculation: fibonacci(0) = 0, fibonacci(1) = 1, fibonacci(5) = 5, fibonacci(10) = 55.
  • Implemented edge-case handling: raises ValueError("n must be non-negative") for n < 0.
  • Added unit tests in tests/test_math_utils.py covering all normal and negative edge cases.

Test Results

  • All tests pass (100% pytest pass).

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.

1 participant