09.09.2010, 02:25
(
Last edited by Toni; 12/10/2011 at 12:11 AM.
)
Arithmetic Operators
These are operators used everyday, or at least most of them are. In SA:MP's case being used inside PAWN, they are probably used like every other piece of code, used for calculating different things such as height, width, length and position. Math in these languages are common and are used for various items!Operator | | | Definition | | | Example |
+ | | | Addition: Increasing numbers resulting with a sum. | | | 5 + 5 = 10 |
- | | | Subtraction: Decreasing numbers resulting with a difference. | | | 10 - 5 = 5 |
/ | | | Division: Decreasing numbers resulting with a quotient. | | | 10 / 2 = 5 |
* | | | Multiplication: Increasing numbers resulting with a product. | | | 5 * 2 = 10 |
> | | | Greater than: Used to compare two values; the left value is being stated as larger. | | | 10 > 2 |
< | | | Less than: Used to compare two values; the right value is being stated as larger. | | | 2 < 10 |
>= | | | Greater than or equal to: Same as '>' but accepts numbers that are also equal to the same value. | | | x = 10; x >= 10 |
<= | | | Less than or equal to: Same as '<' but accepts numbers that are also equal to the same value. | | | x = 10; x <= 10 |