Most people are familiar with the basic mathematical operations, such as addition, subtraction, multiplication and division, and their operators +, “, , and . However, within the world of the computer we use slightly different notation. While +, “, and = are the same, we use * for multiplication and / for division. Therefore, while in written equations we will see the traditional math operators used, code examples will use the programmatic operators.
Tip | For really intensely technical reasons that are really intensely boring, division is significantly harder for a computer processor than multiplication. If you were to divide 1000 different numbers by 4, it would take noticeably longer than it would to multiply those same numbers by 0.25. Wherever possible, use multiplication instead of division. |
Other functions, such as finding square roots, raising numbers to a power, have notation specific to the computer language you are programming in. MEL is no exception, and contains a variety of specific commands for most common complex math functions. Throughout this book, as with the mathematical operators, we will show both the mathematical notation and the MEL code for any mathematical equation. Unless otherwise stated, notation for any mathematical operation is the same in MEL as it is in standard mathematical notation.