Operators Flashcards
1
Q
+
A
add
2 +4 = 6
2
Q
+
A
add
2 +4 = 6
3
Q
-
A
subtract
4
Q
*
A
multiply
2 *4 = 8
5
Q
**
A
power of
2**4 = 16
6
Q
/
A
Divide
2/4.0 == 0.5
7
Q
%
A
modulus
2 % 4 ==2
8
Q
.
A
Dot access
“1”.to_i == 1
9
Q
::
A
Colon access
Module::Class
10
Q
[]
A
list brackets
[1,2,3]
11
Q
!
A
not
!true == false
12
Q
A
less than
13
Q
>
A
greater than
14
Q
> =
A
greater than or equal to
15
Q
<=
A
less than or equal to
16
Q
<=>
A
comparison
4 <=> 4 == 0
17
Q
==
A
equal
4 =4 = true
18
Q
===
A
Equality
4 ===4 = true
19
Q
!=
A
not equal
4 != 4 = false
20
Q
&&
A
Locical and (higher precedence) true && false = false