I’m getting some odd behavior I don’t understand in this activity: Doenet
If you look at version d, the numerical entries in the table are displayed to two decimal places, in line with syntax like “$$FP(6)”. But if you look at other versions, such as a, b, or c, that same syntax leads to output on the screen like “-288exp(-9/25)/25”.
1 Like
It turns out that the difference is that for variant d, the selectFromSequence for k is giving 0.05, but it isn’t quite the closest floating point approximation to 0.05. That messes up the simplification routines, as it is not recognized as 1/20, making variant d give decimals.
I consider that a bug in selectFromSequence that we can fix.
If you do want to make sure that it is a decimal, you could put it inside a <number>. I don’t believe we have any flag on <math> for force decimal approximations.
I filed a bug report.
In the meantime, a workaround is to use integers in the selectFromSequence.
<selectFromSequence name="kk" from="45" to="60" step="5" />
<function name="F">68 + $A*e^(-$kk*x/1000)</function>
Thanks Duane. The change to did what was needed.