Skip to content
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

feat: Intro primitives #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anonfedora
Copy link

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