Implementing other special methods
In addition to the core arithmetic and comparison operators, we have a group of additional operators that (generally) we only define for the numbers.Integral
values. Since we're not defining integral values, we can avoid these special methods:
Method |
Operator |
---|---|
|
|
|
|
|
|
|
|
|
|
Also, there are reflected versions of these operators:
Method |
Operator |
---|---|
|
|
|
|
|
|
|
|
|
|
Additionally, there's a unary operator for a bit-wise inverse of the value:
Method |
Operator |
---|---|
|
|
Interestingly, some of these operators are defined for the set collection, as well as integral numbers...