Repeat can have problems when using "raised to" tile

Report bugs. Post bug workarounds or fixes

Moderator: MSandro

Post Reply
MrSteve
Posts: 61
Joined: Jun 16th, '16, 01:22

Repeat can have problems when using "raised to" tile

Post by MrSteve » Jul 31st, '16, 04:54

Ran into this problem (using v51) using the following:
Screen Shot 2016-07-31 at 12.25.11 AM.png
Which you would think would create 16 instances of an object, but it only create 15!

Found that the generic implementation of "raised to" tile is implemented as follows:
Screen Shot 2016-07-31 at 12.31.40 AM.png


Problem seem to be that the ln tile only uses 5 place of decimal accuracy, so ln(4) = 1.38629 and exp (2 * 1.38629) = 15.9998604448

See attached project where the scriptlets on the left work, but the ones on the right don't.

Could modify repeat to round up or perhaps use this as an opportunity to teach about the challenges of floating point arithmetic :)
Note: the display when you click on "4 raised to 2" does display 16 (as does debugger when I set a local variable to "4 raised to 2"

One other bug (in attached project). When you open repeatError.gpp (or at least on my v51 version) you do not see any classes. Yet it you add a class then click in the class section it appears. This MAY be due to there not being any instances of the object when I saved it, will test
Attachments
repeatError.gpp
(4.74 KiB) Downloaded 328 times
Screen Shot 2016-07-31 at 12.25.23 AM.png

Post Reply