I was trying to reach 0,0,0 in a world when I noticed that one of my coordinates read "-0.[someDecimal]"
Can someone explain to me what this means, and how it's possible?

I was trying to reach 0,0,0 in a world when I noticed that one of my coordinates read "-0.[someDecimal]"
Can someone explain to me what this means, and how it's possible?

It's gotta be a glitch! Maybe it was Herobrine? Possibly a mod?
Oh wait, no, it's subtraction.

The way you normally encode integer numbers in computers is called "two's complement" (http://en.wikipedia.org/wiki/Two's_complement). It's convenient in many ways, but one quirk of it is that you have two ways to represent a zero. There is essentially a zero with positive sign, and a zero with negative. They're treated exactly the same in any calculation (the big benefit of two's complement is that you don't have to treat negative numbers differently) so there's no problem using it.

Often, number output code would check for this particular case and simply not show the negative sign. I guess the code here doesn't. It's just a quirk though, and nothing to worry about.

EDIT: I remembered that the coordinates are probably represented as floating point rather than fixed-point decimal (this seems pretty weird to me, but what do I know). You have the same thing with IEEE floating point though: there's two zeros with different sign but they're normally treated identically so, again, just a small oddity with no practical implications.

EDIT (Again): Agh, forget it. I mixed up one's complement and two's complement representation. I've been away from CompSci for too long... Anyway, FP can indeed have two zeros.

You just proved in your post that it is NOT negative zero. You said there were decimals after the zero. You can certainly have a negative decimal. -0.5, -0.2367, etc. If it were EXACTLY 0, then obviously just 0 cannot be negative. Maybe in programming like this it could display -0, but as far as mathematical concepts go there is no such thing as -0. Or +0. Just 0.

The way you normally encode integer numbers in computers is called "two's complement" (http://en.wikipedia.org/wiki/Two's_complement). It's convenient in many ways, but one quirk of it is that you have two ways to represent a zero. There is essentially a zero with positive sign, and a zero with negative. They're treated exactly the same in any calculation (the big benefit of two's complement is that you don't have to treat negative numbers differently) so there's no problem using it.

Often, number output code would check for this particular case and simply not show the negative sign. I guess the code here doesn't. It's just a quirk though, and nothing to worry about.

Ah, thank you.

Edit:

Quote from mattinsa »

You just proved in your post that it is NOT negative zero. You said there were decimals after the zero. You can certainly have a negative decimal. -0.5, -0.2367, etc. If it were EXACTLY 0, then obviously just 0 cannot be negative. Maybe in programming like this it could display -0, but as far as mathematical concepts go there is no such thing as -0. Or +0. Just 0.

That would make sense. But what if I got to -0? The post above yours explains that, but contradicts you saying it's impossible.

You just proved in your post that it is NOT negative zero. You said there were decimals after the zero. You can certainly have a negative decimal. -0.5, -0.2367, etc. If it were EXACTLY 0, then obviously just 0 cannot be negative. Maybe in programming like this it could display -0, but as far as mathematical concepts go there is no such thing as -0. Or +0. Just 0.

That would make sense. But what if I got to -0? The post above yours explains that, but contradicts you saying it's impossible.[/quote]

I amended my above post: there is both a positive and a negative zero in standard floating point representations. Again, they are exactly the same in practice.

If you reached 0,0,0 your Y coordinate would be the bottom-most layer of the world. And when looking at your coordinates, it's taken from eye level, so your feet would be in the void, meaning you're going to die. Also, if there's bedrock there, unless you remove it with a hack/mod, you can't get to it.

Simple to prove that: Minecraft counts from the very bottom of the chunk. At height 0, you'd be in the very lowest layer with nothing below you - therefore you'd fall into the void and die.

However, to prevent this, the bedrock/adminium layer is at the bottom and since it's unbreakable, you cannot get to 0 height.

You can get to 0 height, there are holes in the bedrock, but the odds of one being at 0,0,0 are very slim.

simple answer really. its a negative decimal. truncate the 0 to make it -.65024365 or whatever the decimal was. like .25 for example. its the same as 0.25. -.25 and -0.25 are the same. you see? if the decimal is what i said above (65024365), then it is a negative number just below zero, but not big enough to be one.

The way you normally encode integer numbers in computers is called "two's complement" (http://en.wikipedia.org/wiki/Two's_complement). It's convenient in many ways, but one quirk of it is that you have two ways to represent a zero. There is essentially a zero with positive sign, and a zero with negative. They're treated exactly the same in any calculation (the big benefit of two's complement is that you don't have to treat negative numbers differently) so there's no problem using it.

Often, number output code would check for this particular case and simply not show the negative sign. I guess the code here doesn't. It's just a quirk though, and nothing to worry about.

Ah, thank you.

Edit:

Quote from mattinsa »

You just proved in your post that it is NOT negative zero. You said there were decimals after the zero. You can certainly have a negative decimal. -0.5, -0.2367, etc. If it were EXACTLY 0, then obviously just 0 cannot be negative. Maybe in programming like this it could display -0, but as far as mathematical concepts go there is no such thing as -0. Or +0. Just 0.

That would make sense. But what if I got to -0? The post above yours explains that, but contradicts you saying it's impossible.

dude. you didn't get to -0. therefore you don't know if you can, and if one of them did hit 0, it wouldn't be negative, and if it was, then the two's compliment mentioned in an earlier post would be exactly why. -0 and 0 are equal. therefore the computer's calculations do not care which one it outputs.

First off, Minecraft coordinates are floating point numbers, so it uses a sign bit an, a bias-n exponent, and a normalized mantissa instead of 2's compliment. Second, 2's compliment doesn't have a negative zero.1's compliment, however, does (which is why it's not used very often).

As for your situation, you were at a coordinate in range [-1,0], that's all. The coordinates inside blocks are measured as the decimal part of the coordinate (each block is an integer part).

The way you normally encode integer numbers in computers is called "two's complement" (http://en.wikipedia.org/wiki/Two's_complement). It's convenient in many ways, but one quirk of it is that you have two ways to represent a zero. There is essentially a zero with positive sign, and a zero with negative. They're treated exactly the same in any calculation (the big benefit of two's complement is that you don't have to treat negative numbers differently) so there's no problem using it.

Often, number output code would check for this particular case and simply not show the negative sign. I guess the code here doesn't. It's just a quirk though, and nothing to worry about.

Ah, thank you.

Edit:

Quote from mattinsa »

You just proved in your post that it is NOT negative zero. You said there were decimals after the zero. You can certainly have a negative decimal. -0.5, -0.2367, etc. If it were EXACTLY 0, then obviously just 0 cannot be negative. Maybe in programming like this it could display -0, but as far as mathematical concepts go there is no such thing as -0. Or +0. Just 0.

That would make sense. But what if I got to -0? The post above yours explains that, but contradicts you saying it's impossible.

dude. you didn't get to -0. therefore you don't know if you can, and if one of them did hit 0, it wouldn't be negative, and if it was, then the two's compliment mentioned in an earlier post would be exactly why. -0 and 0 are equal. therefore the computer's calculations do not care which one it outputs.

It may be hypothetical, but still, like i said, that doesnt change the fact that the two's compliment answers your question. -0 and 0 are the same thing. Therefore a computer calcuating your coordinates on the world would output them either way.

Can someone explain to me what this means, and how it's possible?

It's gotta be a glitch! Maybe it was Herobrine? Possibly a mod?

Oh wait, no, it's subtraction.

Often, number output code would check for this particular case and simply not show the negative sign. I guess the code here doesn't. It's just a quirk though, and nothing to worry about.

EDIT: I remembered that the coordinates are probably represented as floating point rather than fixed-point decimal (this seems pretty weird to me, but what do I know). You have the same thing with IEEE floating point though: there's two zeros with different sign but they're normally treated identically so, again, just a small oddity with no practical implications.

EDIT (Again): Agh, forget it. I mixed up one's complement and two's complement representation. I've been away from CompSci for too long... Anyway, FP can indeed have two zeros.

Ah, thank you.

Edit:

That would make sense. But what if I got to -0? The post above yours explains that, but contradicts you saying it's impossible.

That would make sense. But what if I got to -0? The post above yours explains that, but contradicts you saying it's impossible.[/quote]

I amended my above post: there is both a positive and a negative zero in standard floating point representations. Again, they are exactly the same in practice.

-0.12234678364276 is a number.

-0 is not a number. It is just 0

Once you add the decimal it is just a number.

-0.237647 is as much as a number as -25 is.

And btw, 0,0,0 is impossible to reach in Minecraft. If you reach it, you die. Getting close is also very unlikely.

oh realy? you die? prove it.

You can get to 0 height, there are holes in the bedrock, but the odds of one being at 0,0,0 are very slim.

dude. you didn't get to -0. therefore you don't know if you can, and if one of them did hit 0, it wouldn't be negative, and if it was, then the two's compliment mentioned in an earlier post would be exactly why. -0 and 0 are equal. therefore the computer's calculations do not care which one it outputs.

doesn't have a negative zero.1's compliment, however, does (which is why it's not used very often).As for your situation, you were at a coordinate in range [-1,0], that's all. The coordinates inside blocks are measured as the decimal part of the coordinate (each block is an integer part).

One word: Hypothetical.

Edit: The devil's post.

It may be hypothetical, but still, like i said, that doesnt change the fact that the two's compliment answers your question. -0 and 0 are the same thing. Therefore a computer calcuating your coordinates on the world would output them either way.