-
Notifications
You must be signed in to change notification settings - Fork 2
Booleans
iaminfinityiq edited this page Feb 20, 2026
·
1 revision
This data type has 2 possible values: true and false. When performed in arithmetic operators and comparison operators, true acts as 1, and false acts as 0. Comparison operations on built-in data types like ==, !=,... returns this data type
-
+: Addition. This can be performed onint,double, andboolean. This can also be interpreted as unary plus if used as+<value> -
-: Subtraction. This can be performed onint,double, andboolean. This can also be interpreted as unary minus (negation) if used as-<value> -
*: Multiplication. This can be performed onint,double, andboolean -
/: Division. This can be performed onint,double, andboolean -
%: Modulo (get the remainder of a division). This can be performed onint,double, andboolean. This can also be interpreted as percentage if used as<value>% -
==: Acts as equality comparison -
!=: Reverse of== -
>: Greater than. This can be performed onint,double, andboolean -
<: Smaller than. This can be performed onint,double, andboolean -
>=: Greater than or equals. This can be performed onint,double, andboolean -
<=: Smaller than or equals. This can be performed onint,double, andboolean -
&&: And operation, returnstrueif both of the inputs aretrue, else returnsfalse. This operation uses a short-circuit technique that returnsfalseimmediately without checking the right side if the left side isfalse. This can be performed onboolean -
||: Or operation, returnstrueif at least one of the inputs aretrue, else returnsfalse. This operation uses a short-circuit technique that returnstrueimmediately without checking the right side if the left side istrue. This can be performed onboolean -
!: Not operation, denoted as!a, returns the opposite ofa