<when green flag clicked> <delete ( all ) of { q } > <add ( 0.0005 / 5000 ) to { q }> <think ( [item ( 1 ) of { q }] * 1 )> <end script>
Notice that the division and insert into a list variable (with the implicit cast to a string type that this entails) produces a value in scientific-notation within the list.
The forced cast back to a numeric value via the multiplication operator fails to properly parse the scientific notation and results in only the mantissa being evaluated without the exponent.
This could be remedied either by avoiding the use of scientific notation when inserting into list variables as seems already to be the case with non-list variables, or by enhancing the number-parser to correctly interpret scientific notation.
-Aaron
Offline
uhhh.... i'll try it out on scratch and see what you're talking about.
Offline
What he means is, the system was confused by exponents.
Offline
If you need help, here are some terms:
1. Mantissa: The whole number part of a decimal.
2. Exponent: The fractional portion.
3. String: A "string" of characters (hence the name)
4. Scientific notation: A number that includes the letter E. (e.x. 1.0E6 = 1,000,000)
EDIT: I learned the first 2 in a C/C++ book written for people double my age! 3 from a Java book, and 4 I figured out.
Last edited by scratchisthebest (2009-05-18 17:41:41)
Offline