Error: <<set>>: bad evaluation: Unexpected end of input

Hi there, for the following code:
<<set $ts = ($x - 0.3) / ($s / Math.sqrt($n) )>>
<<set $pv = 0>>
<<set $cR_u = (0.3 + (2.045 * ($s / Math.sqrt($n))>>
<<set $cR_l = (0.3 - (2.045 * ($s / Math.sqrt($n))>>

I receive this error:
Error: <>: bad evaluation: Unexpected end of inputn the screenshot I am receiving this error:

What is wrong with these set statement?

In the third and fourth statements, your numbers of opening parentheses and closing parentheses don’t match.

3 Likes

@marcusjames0930
Please use the Preformatted Text </> option when adding a code example to your comments, it helps distinguish the code from the other text, and stops the forum’s software mistakenly converting Standard quotes in that code into Typographical (curvy) quotes.
eg. the following is what your example looks like when the Preformatted Text option is used.

<<set $ts = ($x - 0.3) / ($s / Math.sqrt($n) )>>
<<set $pv = 0>>
<<set $cR_u = (0.3 + (2.045 * ($s / Math.sqrt($n))>>
<<set $cR_l = (0.3 - (2.045 * ($s / Math.sqrt($n))>>

As @EJoyce explained, the number of open ( parentheses and close ) parentheses need to be the same in each expressions…

eg. both of the above macro calls have 4 open ( parentheses in them but only 2 close ) parentheses, so they are both missing 2 more close ) parentheses.

2 Likes