This repository was archived by the owner on Jan 26, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Order of operations
Peter Tillema edited this page Nov 26, 2018
·
4 revisions
If you made it through middle school, you (hopefully) know of the mathematical order of operations, known as "PEMDAS". This simple string of letters tells us the order in which we do math when we come across an expression with more than one operation in it. ICE properly follows this order. For those who don't remember, the order is:
Operation | Explanation |
---|---|
Parenthesis | Do what is inside parentheses first. |
Exponents | Solve the exponents (this includes roots). |
Multiplication and Division | Both at the same time, from left to right. |
Addition and Substraction | Both at the same time, from left to right. |
This means that if ICE comes across 8+(40−7∗2)
, it will do 7∗2=14
, then 40−14=26
, then 8+26=34
.
ICE Compiler | Peter Tillema
- Introduction
- Building your first program
- Math and numbers
- Variables
- Standard system commands
- Program flow control
- Pointers
- Graphics
- Sprites
- Tilemaps
- Useful routines