This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-04-13 17:16:12

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

65536^3 ≠ 281474976710674

65536^3 ≠ 281474976710674
Seriously, try uploading a project that does 65536^3 and puts it in a variable. (It's actually 281474976710656.)

But that's what flash says. Offline scratch works much better, it goes accurately up to 10^60 or so, while the flash player only goes to 10^18. Could big number calculations in flash be improved?

(I guess this means my perlin noise doesn't work right)


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#2 2013-04-13 17:33:52

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: 65536^3 ≠ 281474976710674

Might have to do with how Flash handles floating point numbers.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#3 2013-04-14 09:30:04

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: 65536^3 ≠ 281474976710674

Bump.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#4 2013-04-15 13:18:14

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: 65536^3 ≠ 281474976710674

On 2.0 it worked right for me  hmm
How are computing the exponents? I'm doing 65536*65536*65536.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#5 2013-04-15 17:57:14

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: 65536^3 ≠ 281474976710674

I'm using 1.4's old flash player, checking in a bit.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#6 2013-04-16 22:59:44

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: 65536^3 ≠ 281474976710674

I think it is because you overflowed the variable:
a variable can go up to a certain number, like 2546274531 or something. Once it excedes that number, the number is then turned into weird numbers, like -0.565343435343545.

in this case, 35536^3 may have overflowed the variable.

Last edited by KrIsMa (2013-04-16 23:00:14)


http://blocks.scratchr.org/API.php?user=KrIsMa&action=onlineStatus&online=http://i49.tinypic.com/2pzic0m.png&offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#7 2013-04-16 23:02:15

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: 65536^3 ≠ 281474976710674

technoguyx wrote:

Might have to do with how Flash handles floating point numbers.

wait, how does 65536^3 have floating numbers?
isnt it all integers?


http://blocks.scratchr.org/API.php?user=KrIsMa&action=onlineStatus&online=http://i49.tinypic.com/2pzic0m.png&offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#8 2013-04-18 11:19:49

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: 65536^3 ≠ 281474976710674

KrIsMa wrote:

technoguyx wrote:

Might have to do with how Flash handles floating point numbers.

wait, how does 65536^3 have floating numbers?
isnt it all integers?

It's because the number is too big to represent as a binary integer so it represents it as a floating point. It takes the closest number to it that is in the form X * (2^Y)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

Board footer