Overview
Expresioes supports standard arithmetic operations with proper operator precedence. This guide demonstrates how arithmetic expressions are evaluated, including parentheses for controlling evaluation order.Supported Operators
| Operator | Description | Precedence |
|---|---|---|
* | Multiplication | High |
/ | Division | High |
+ | Addition | Medium |
- | Subtraction | Medium |
() | Parentheses | Highest |
Simple Arithmetic Example
Here’s a basic program demonstrating arithmetic operations:Expected Output
Symbol Table
Operator Precedence
Expresioes follows standard mathematical operator precedence:Execution Flow
Using Parentheses
Parentheses override the default precedence:Expected Output
Working with Floats
Expresioes supports floating-point arithmetic:Expected Output
Symbol Table
Best Practices
Use Parentheses for Clarity
Use Parentheses for Clarity
Even when not strictly necessary, parentheses make your intent clear:
Be Aware of Integer Division
Be Aware of Integer Division
Division between integers truncates the decimal part:
Initialize Variables
Initialize Variables
Always initialize variables before using them in expressions:
Next Steps
Conditionals
Learn about if-else statements and logical operators
Complex Programs
Explore advanced programs with nested logic