The transition between negative and positive numbers fascinates me…at the point that we call"zero", there is an abrupt change…is there a negative and positive side to zero? Or is zero undefined (like infinity)?
I’m not mathmatician, but here’s my answer:
Zero is a point, like any other number. It has no range or ‘width’; zero is lack of anything.
Zero is indivisible, and is simply the boundary separating the positive from the negative. You seem to be implying that there’s a sort of negative boundary to the zero, distinct from a positive boundary, as if zero contains the span of numbers from -0.00000…1 to +00000…1. It doesn’t; it’s simply the indivisible point in the middle.
Yes and no. No, as others have mentioned, but yes we sometimes differentiate whether a function approaches zero from one side or the other. I think this webpage mentions that–I’m not sure.
0 is just there, separating the positive numbers from the negative ones. Just like 1 separates the numbers less than 1 from the ones greater. Or just as sqrt(2) separates the positive numbers whose square is less than 2 from the positive numbers whose square is greater than 2. And yes, 0 is a clear and definite concept, unlike infinity.
If we define f(x) = 0 when x = 0, and f(x) = x/|x| otherwise, then f is well-defined but discontinuous. For x < 0, f(x) = -1, f(0) = 0, and when x > 0, f(x) = 1. That’s known as the sign function, because the only information it retains about its argument is the sign.
As an artifact of their design, some computers have a +0 and a -0. But most modern computers don’t, however, and those that do are becoming rarer and rarer.
How does this work? Well, it comes of how the computer represents negative numbers. Remember that internally, a computer deals with electrical switches. A switch can be on or it can be off, which means boolean, or two-valued, logic dictates the details of its design. Humans commonly represent these two states with binary numbers, using 0 to represent off and 1 to represent on. These numbers are called bits, for binary digits.
It isn’t obvious how to make a pattern of switches represent a negative number. Three systems sprang up throughout the history of computing: signed magnitude, one’s compliment, and two’s compliment. I’ll take them in turns.
Signed magnitude is accomplished when the bit in the most-significant position determines the number’s sign. If it’s set, the number is negative, and if it’s unset, the number’s positive. A lot of old machines used this, and its simplicity is appealing until you try to do math. You, as the programmer, need to watch the signs of the numbers you’re working with, because the machine will not. It is very possible to create -0, which is not equal to +0. This is less than convenient.
One’s compliment is accomplished by forming a negative number by taking a positive number and negating each bit in that number in turn. So if 0101 is 5, 1010 is -5. In this four-bit system, -5 + 5 = 0101 + 1010 = 1111 = -0, and -0 + 1 = 1111 + 1 = 0000 = +0. Again, -0 rears its ugly head.
Two’s compliment is accompished by taking the one’s compliment of a number and adding one to it to create the negative form of the number. If 0101 is 5, 1011 is -5. In this system, -5 + 5 = 1011 + 0101 = 0000= 0. -0 does not exist in a two’s compliment system. Two’s compliment is the system used by nearly all modern machines, including all desktop systems (IIRC).
While modern computers don’t use sign-magnitude for integers, they do tend to use IEEE 754 format to represent floating point numbers, which is sign magnitude.
Good youth angst band name: Negative Zero
John T Conklin: That’s right. And I was doing some 8087 assembly programming here recently. That’s what I get for posting in haste.
Suppose ZERO was not a point but a two-dimensuinal string? Would it then possible alternate between positive and negative?
It doesn’t really matter: As it stands, zero is a point just like any other.
Being greater than 0 is no different a property from being greater than 1. We just emphasize the first more.