Bro i just found out that there is a -0 in godot and it is scaring me

bruh
image
no way godot do this to me

3 Likes

Well, it’s not -0 exactly, it’s -0.00000006…something. How else would you want a small negative float number represented? :slight_smile:

4 Likes

ik but it annoys me seeing the -0 beforehand

What else would like it to show instead?

6 Likes

Negative zero is indeed a thing in floating point numbers though, as well as positive/negative infinity and NaN (not a number). This isn’t unique to godot but floating point numbers in general (at least all the formats of floating point numbers I’ve ever used).

6 Likes

You should need to put it in “General” category instead of “Showcase”.

Also I think this is not a thing to fun, it’s common. So it is better if you create this post in reddit instead of forum. Reddit of Godot has a category of “Fun & Meme”.

4 Likes

idk 0 …

ohh ok thx

1 Like

ohh ok

But 0 is not the same as 0.00000006 and not the same as -0.00000006

5 Likes

i guess i learnt something new :slight_smile:

1 Like

ok good to know

1 Like

Think of positive and negative as just different directions rather than amounts.

5 Likes

thats still valid though since its not really a zero zero

2 Likes

Negative zero is a thing but its usually meant that it isnt exactly zero but the resolution inst available to give a precise value.

3 Likes

Screenshot_2024-12-25-11-13-14-210_org.godotengine.editor.v4

1 Like

jan Misali’s got a pretty good video explaining the IEEE-754 floating point spec - it goes through all its decisions and some of the reasons they’re like that

3 Likes

sure ill watch

but if 0 is a number telling u that a number is too small than wouldn’t -0 be = to 0

In your screenshot there is never -0. There are other negative values close to zero, but never exactly zero.

4 Likes