Skip to content

Add basic arithmetic operations to Math.py#16

Open
nborges-aws wants to merge 1 commit intomainfrom
setup-repository-access-20251218-210139
Open

Add basic arithmetic operations to Math.py#16
nborges-aws wants to merge 1 commit intomainfrom
setup-repository-access-20251218-210139

Conversation

@nborges-aws
Copy link
Owner

Summary

This PR extends the Math.py module with additional basic arithmetic operations, complementing the existing add function with four new mathematical operations.

Changes Made

  • Added subtract function: Takes two integers and returns their difference
  • Added multiply function: Takes two integers and returns their product
  • Added divide function: Takes two integers and returns their quotient (integer division)
  • Added modulo function: Takes two integers and returns the remainder
  • Created .gitignore: Added Python cache files and IDE/OS specific files to prevent accidental commits

Implementation Details

  • All new functions follow the same code style and pattern as the existing add function
  • Type hints are consistently used (int type annotations for parameters and return values)
  • Functions maintain a clean, simple implementation
  • Code formatting follows Python conventions with proper spacing between function definitions

Testing Considerations

The new functions provide essential mathematical operations that can be tested with various integer inputs:

  • Division operation uses integer division (//) to maintain consistency with return type hint
  • Modulo operation provides remainder calculation capability

Files Modified

  • src/Math.py - Added subtract, multiply, divide, and modulo functions
  • .gitignore - New file to exclude build artifacts and system files

Co-authored-by: Nicolas <183529338+nborges-aws@users.noreply.github.com>
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