4
deck
How to Read Arithmetic Operators
| Symbol | Meaning | Pronunciation (stressed syllable) |
|---|---|---|
| + | addition | a[DI]tion |
| - | subtraction | subtr[AC]tion |
| * | multiplication | multipli[CA]tion |
| / | division | di[VI]sion |
| % | modulus, modulo | [MO]dulus, [MO]dulo |
| ** | power, exponent | [PO]wer, [EX]ponent / expo[NEN]t |
| = | assignment | a[SSI]gnment |
===
Expressions in Code
| Symbol | English Term | Code Example | Interpretation |
|---|---|---|---|
| + | plus | 5 + 3 = 8 | 5 plus 3 is 8 |
| - | minus | 10 - 4 = 6 | 10 minus 4 is 6 |
| * | times, multiplied by | 6 * 7 = 42 | 6 times 7 is 42 / 6 multiplied by 7 is 42 |
| / | divided by | 20 / 5 = 4 | 20 divided by 5 is 4 |
| % | modulo, mod, remainder when divided by | 10 % 3 = 1 | 10 modulo 3 is 1 / 10 mod 3 is 1 / the remainder when 10 is divided by 3 is 1 |
| ** | to the nth power, squared, cubed | 2 ** 3 = 8 | 2 to the 3rd power is 8 |
| 5 ** 2 = 25 | 5 squared is 25 / 5 to the power of 2 is 25 | ||
| 4 ** 3 = 64 | 4 cubed is 64 | ||
| = | assigned to, is set to | x = 10 | x is assigned to 10 / x is set to 10 |
- In programming,
=signifies assignment, which is different from equal in mathematics.
===
Expressions of Increase and Decrease
| Verb | Example |
|---|---|
| increment | A variable that is incremented by 2 on each iteration of a loop. |
| increase | Increase the variable x by 2. |
| decrement | The variable x is decremented by 1 in each recursive call. |
| decrease | Decrease the variable x by 2. |
incrementtypically refers to a small increase or increment unit and is mainly used as a noun.increaseis used for general growth and can be both a verb and a noun.decrementanddecreaseshare a similar relationship.
===
Expressions for Comparison Operators
| Symbol | English Phrase | Example | Interpretation |
|---|---|---|---|
== | equals / is equal to | 5 == 5 | 5 equals 5 / 5 is equal to 5 |
!= | not equal to | 5 != 3 | 5 is not equal to 3 |
> | greater than | 7 > 3 | 7 is greater than 3 |
< | less than | 3 < 7 | 3 is less than 7 |
>= | greater than or equal to | 4 >= 4 | 4 is greater than or equal to 4 |
<= | less than or equal to | 2 <= 5 | 2 is less than or equal to 5 |
===
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.