KaizeNodeLabs / stark-cairo-nodes

Set of scripts written in Cairo/Starknet to learn and teach newcomers the ecosystem.
MIT License
10 stars 10 forks source link

feat: add simple_math directory with arithmetic operations #17

Closed derianrddev closed 2 weeks ago

derianrddev commented 2 weeks ago

Pull Request

Issue

Description

  1. Creation of the simple_math directory:
    The simple_math directory was created at the path cairo/scripts/simple_math.

  2. File simple_math.cairo: A new file named simple_math.cairo was added to the src directory of simple_math.

  3. Arithmetic Functions:
    Functions for each basic arithmetic operation were implemented:

    • Addition (+)
    • Subtraction (-)
    • Multiplication (*)
    • Division (/)
    • Modulus (%)
  4. Function main:
    A main function was created with examples to execute all operations and display the results.

Screenshots

image

Additional Notes

In the division example, I included a clarification that says “in Cairo, the division returns only the integer part, no decimals”. Since these examples are designed for newcomers to the Cairo ecosystem, I thought it was a good idea to provide this additional information to facilitate their understanding.

danielcdz commented 2 weeks ago

@derianrddev Good PR overall excellent work! 🫡 Just left some minor comments

derianrddev commented 2 weeks ago

@danielcdz Ready, I have made the changes