| Start |
|---|
| Math using dc
It is using the reverse polish notation (opens new window), which means that you are first stacking numbers, then operations. For example To print an element from the top of the stack use command You can print the top element many times For negative numbers use You can also use capital letters from
We can increase the precision using command You can also use it over multiple lines
|
| Math using bc
For example, it can print out the result of an expression: For floating-post arithmetic, you can import standard library It can be used for comparing expressions: |
| Math using bash capabilities Arithmetic computation can be also done without involving any other programs like this: Multiplication: Division: Modulo: Exponentiation: |
| Math using expr
Basic arithmetics When multiplying, you need to escape the You can also use variables Keep in mind that it only supports integers, so expression like this will throw an error It supports regular expression to match patterns Or find the index of the first char in the search string This will throw |
Read Article
https://develop.horje.com/learn/1434/reference