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

#1 2008-11-21 05:42:15

yescurtischou
Scratcher
Registered: 2008-11-21
Posts: 1

bug? big number

let variable <a> = 1073741824 / 2
store <a> to the 1st position of a list, alist[1]
let variable <b> = alist[1]

Guess what?  <a> does NOT equal to <b>
For example:

let <ai> = log of <a>
let <bi> = log of <b>
let <bib> = 10 ^ <bi>

Now, <ai> is 8.7, <bi> is 0.7, and <bib> is 5.4

Offline

 

#2 2008-11-21 09:08:47

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: bug? big number

You are definately on to something here!  I verified your results.

I think what is happening is that when the number gets stored in exponential notation in the list it gets interpreted as a text string by the list.  Then, when the value is dumped back into a variable, it looks correct, but internally it is being stored as a text string.  So when the the log operator is applied to it, only the numeric portion (before the "e") is being processed by the operator.

Sounds like a bug to me.  Good catch!

I put the project that shows the problem here

http://scratch.mit.edu/projects/Paddle2SeeFixIt/327507

Oddly enough, it works fine in the Java Player!  So it is only a bug in Scratch.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer