Discuss Scratch

timothymhuang
Scratcher
50 posts

Biggest Number

What is the biggest number scratch can handle? Once the number is too big, scratch will start treating the numbers like infinity. I want to know at what point it will do that. Also at what point will scratch start using scientific notation?

Last edited by timothymhuang (Aug. 17, 2018 00:30:58)

TechEpic
Scratcher
100+ posts

Biggest Number


Through testing, I've determined that the lowest integer represented using scientific notation appears to be 10^21.

Through some quick testing it looks like there isn't a direct cutoff for the maximum number, but rather that larger numbers seem to gradually get more buggy. I found that at around 2^1005, the display broke down and just showed 0. I also noticed that 1e308 + 1e307 resulted in approximately, 9.88e307, which is incorrect. The first *actual* instance of infinity (where an equals block determined that the variable was equal to Infinity) was at around 2^1024.

I would recommend trying to keep numbers below 1e300.

Last edited by TechEpic (Aug. 17, 2018 02:22:39)

DD-8861
Scratcher
100+ posts

Biggest Number

I did testing with variables. Like TechEpic, I also got that it starts using e notation around 10²¹

For me, it started displaying infinity at e302, which is a little bit below the 2^1024 that techepic got, which is about 1.8e309
TheLogFather
Scratcher
1000+ posts

Biggest Number

Note that there's a discrepancy between when a variable's value overflows to Infinity vs when Infinity gets shown in the variable watcher.

As noted above, the variable watcher shows Infinity by about 1.8x10^302. However, the actual overflow only happens at about 1.8x10^308.

See here for more details: https://github.com/LLK/scratch-flash/issues/614

Last edited by TheLogFather (Aug. 17, 2018 12:25:53)

jan222011
Scratcher
13 posts

Biggest Number

it just says infinity, if it gets too big for it to display.

Powered by DjangoBB