Skip to main content

Arithmetic

info

The Arithmetic module is still in beta 👶

  • Infant lang supports basic arithmetic of integers.
  • Throws error if a division returns a decimal 💀
  • Throws error if pointer or memory becomes negative 💀
note

Division by zero is still not possible 😒

Division by zero is technically not possible 😏

Addition ➕, subtraction ➖, multiplication ✖ and division ➗ of two numbers, with memory or with the pointer and store it in the memory 📦

memory = pointer - pointer
danger

After an arithmetic operation, the memory must be assigned to the result of the operation. Otherwise, the program will stop executing 💀

This will be fixed in the next version of Infant Lang.