-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7f18a1
commit c23dd46
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Basic expressions calculator | ||
|
||
This is an algorithm for calculate many operations at the same time, at the last update is not possible to use parenthesis. | ||
|
||
So an example could be: | ||
|
||
```` | ||
12+2-3+12/2*5 | ||
```` | ||
The result would be | ||
```` | ||
--- Details --- | ||
2*5: 10 | ||
12/10: 1.2 | ||
12+2: 14 | ||
-3+1.2: -1.8 | ||
14-1.8: 12.2 | ||
--- Done --- | ||
The result is: 12.2 | ||
```` | ||
As we can see the details displayed, the expression is resolved in order of "Math Order of Operations": | ||
|
||
1. Multiplication | ||
2. Division | ||
3. Addition | ||
4. Subtraction | ||
|
||
This respository will be updated on the way of my learning path. So I'll be adding features or improvements. |