Skip to content

Conversation

@anonfedora
Copy link
Contributor

Feature: Basic Arithmetic Operations Module

This PR introduces a new module that implements fundamental arithmetic operations using unsigned 8-bit integers (u8).

Changes:

  • Added intro_to_u function demonstrating all arithmetic operations
  • Implemented basic arithmetic functions:
    • sum: Addition of two u8 numbers
    • subtract: Subtraction of two u8 numbers
    • divide: Division of two u8 numbers
    • multiply: Multiplication of two u8 numbers
    • modulo: Modulo operation of two u8 numbers

Each function takes two u8 parameters and returns a u8 result. The main function provides example usage of all operations.

Note: This implementation uses u8 type which has a range of 0-255. Care should be taken to prevent overflow in production use.

Testing:
Basic operations tested with sample values:

  • 5 + 10 = 15
  • 15 - 10 = 5
  • 15 / 10 = 1
  • 15 * 10 = 150
  • 15 % 10 = 5

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