For some reason, whenever you enter '2.53' or '-2.53' into any text block, about 13 0's and and a 2 comes up after the original number.
It's just a weird glitch...
http://scratch.mit.edu/projects/Shadowed1/1481044 - Photo of glitch
Discovered by me.
Last edited by Shadowed1 (2010-12-15 04:32:30)
Offline
This glitch hasn't been mentioned for ages...
I've already forgotten about it.
This glitch also happens for these number: -3.14159265, -1.93, -1.91, -1.89, 1.89, 1.91, 1.93, 3.14159265
(Source: Four glitches on Scratch 1.4)
Last edited by mathematics (2010-12-15 05:22:42)
Offline
O_o WOOOOAH THAT HAPPENSSSSS!!!??? WWWHHHHHAAAAAAAATTT!!!!!????? *checks* WWWWWOOOOOOOAAAAAAAAHHHHHH
Offline
If I remember from an older post, computers are not so absolute with numbers. You could see 1234.5678 on an application, but under the hood it could be 1234.56780000000000000000000000000000000004. The app just removes the extra numbers.
Offline
It's just computer number inaccuracy. I don't fully understand it, but I know it's not specifically a Scratch glitch. It even happens in other programming languages.
EDIT: outposted
Last edited by ScratchReallyROCKS (2010-12-18 07:15:12)
Offline
I just found that if you type 2.53 into a 'Looks' or 'Sensing' block, it's fine. But all the other ones do a really good job of adding on 13 0's and then a 2.
Offline
Shadowed1 wrote:
I just found that if you type 2.53 into a 'Looks' or 'Sensing' block, it's fine. But all the other ones do a really good job of adding on 13 0's and then a 2.
It's because Scratch treats texts in rectangular holes as 'strings' but texts in rounded holes as 'numbers'.
Offline
I just realized that it only happens where it can't be a string.
Last edited by Hitechcomputergeek (2013-04-21 19:34:59)
Offline
ScratchReallyROCKS wrote:
It's just computer number inaccuracy. I don't fully understand it, but I know it's not specifically a Scratch glitch. It even happens in other programming languages.
It's because computers store numbers in binary. Integers can be translated perfectly, but decimals are different. ½ in binary = 0.1, and ¼ = 0.01, 3/8 = 0.011 and 5/8 = 0.101. Mathematical people might begin to see the pattern now. 1/3 in binary = 0.0101 recurring. This is converted back from 0.0101010101 (or however many digits your computer stores it to) as 1/4 + 1/16 + 1/64 + 1/256 + 1/1024. This comes to 0.333007812.
Your computer will do it more accurately as it stores the binary number to many more decimal places. Some numbers though, are particularly difficult to store in binary, and so, when the computer rounds the number, once it has been converted back, incorrectly, these errors creep in. [/longBoringLectureOnMaths]
Offline