Why is there no negative zero and negative minus?
Mathematically, zero is considered neither as a negative nor a positive, because from our number line we say numbers to the left of zero are negative numbers while numbers to the right of zero are positive numbers so the position of zero seems very clear that is "in between" and neutral.
This is basic mathematics.
But from computer science, there's
actually an existence of a negative zero.
Let's walk down the memory lane to floating point-encodings.
In as much as the existence of a negative zero is viewed as a defect in floating-point encodings as a result of two different encodings representing the same value.
Like the decimal representation of the real number where the number $1$ can be represented as two different values of $1.\overline{0}$ or $0.\overline{9}$.
In binary encodings, there exists the two's complement which eliminates distinct positive and
negative zeros but for decimal systems, the digits go from $1$ to $10$ instead of from $0$ to $9$ and even with two's complement $0$ is sometimes grouped with the positive numbers e.g an 8-bit integer encoded using two's complement starts from $0$ to $127$ and $-1$ to $-128$.
But as for the case of a negative minus. There is actually a negative minus which is equal to two either by addition or multiplication.
For example if $x\in\mathbb{Z}$ and $-x\in\mathbb{Z}$ then $x-(-x)=+2x$ then the negative operation of both $x$ yields a positive $+2x$ likewise its multiplication $-x(-x)=x^2$.
0 Comments
Comments