Operators are the most commonly used in programming. They include one, two, and three operators. SWIFT is just as basic as other programming languages. The following is a summary of its unique operators, such as interval operators.
1. unary Operators
= Value assignment operator, which is the most used without any return values
+ Addition (Number Addition, can also be used for character concatenation var Ss = "A" + "B ")
-Subtraction
* Multiplication
/Division
% Perform remainder (the negative number is ignored, and the floating point number can also perform remainder)
> Greater
<Less
2. Binary Operators
++ Auto-increment (that is, the abbreviation of I = I + I, which can be frontend ++ I, or suffix I ++. The same is true. frontend time: auto-increment and then return, post: return and auto-increment)
-- Auto-subtraction (equal to I = I-I)
+ = I + = A is short for I = I +
-= Same as above
= Equal
! = Not equal
> = Greater than or equal
<= Less than or equal
3. Ternary Operators
=== Heng et determines whether two objects reference the same object instance
! = Non-Constant
? : Question? True Answer: false answer, for example, VAR a = 0; print ("\ (a> 0? ) ") Output 2
A... B full closed intervals include A and B
A. B semi-closed intervals include a, excluding B.
4. logical operators! & | Non-or (the second is not calculated if the sum or the first condition is met. This is short circuit calculation)