Advanced Arithmetic Operations on Integers
This lesson is a continuation of the previous lesson, and it explores some advanced arithmetic operations that we can perform with integers in D.
We'll cover the following...
We'll cover the following...
Arithmetic operations with assignment #
All of the operators that take two expressions have assignment counterparts. These operators assign the result back to the expression that is on the left-hand side:
Negation: - #
This operator converts the value of the expression from negative to positive or vice versa:
It is different from subtraction because it takes only one operand. Since unsigned types cannot have negative values, the result of using this operator with unsigned ...