Sorcery with Float Point Error

Voila! Look at this!

https://gyazo.com/2faa99fbffa3ef09bb5f8294d8dd15e9


What the Bug Is The Floating Point Error

Oh noes! It affects whole numbers? That’s just insane!! Can you believe it? Earlier it was tons of decimals into parts, now it’s inside whole numbers? What sorcery is this?


Reproduction:

  • Create an instance of a normal part.
  • Type in any number as high as you can think of.
  • Result as in the gif above.

Side notes:

  • Bug occurs 100% of the time.
  • It is a classic floating point error, and I really hate this.

Explanation:

As mentioned earlier, it’s floating point errors, computers aren’t as accurate as they are. They sometimes mess up and create those errors. It might not be exactly 1, it could be 1.00000000042829.

If you want an in-depth explanation, check out this page all about it!

There are two types of errors: Cancellation & Rounding.
Both explained in the wikipedia page link above.

Now who told us that computers can be very precise? They can still fail at tasking some numbers correctly and precisely. And boom, a flaw was born within computers.


This is addressed for those who doesn’t understand the super-slim gaps in building, excessive decimals in printing certain values, or even anything that comes along with numbers.

3 Likes

Yeah I think this has been addressed before:

https://devforum.roblox.com/t/floating-points-inaccuracies/95358

1 Like

This is not a building problem, not any game-breaking problem either. I just checked the reflectance property, tested it and got a whole number of 999999999998528529(example) from 1000000000000000000.

I assume that it also affects super large numbers above millions. Right?

Why do you need numbers that are so unfathomably large?

1 Like

I didn’t need those numbers, because I was tired. So I decided to do this as the last activity of yesterday. :joy:

Really annoys me with decimals where I type 0.1 or 0.2 and it will literally in that second change it to 2.0000001 or 1.00000001

7 Likes

I feel this bug is a result of Roblox still running in 32-Bit mode for whatever reason. 32-Bit is now kind of obsolete, unless you’re running a 15 year old computer.

2 Likes

Large or small numbers, it doesn’t matter by A + B.

print(math.sin(math.rad(180)))
--1.2246467991474e-16

The following code should return 0, but we get something else.

1 Like

I’m just curious if the float point error is somehow related to Lua’s number limitation?

Mostly machine-limitations, anything that is the power of 2 is fine. That’s why bits and bytes conversion of values are in the power of 2.

Also not to mention the binary system: 1s and 0s.

2 Likes