You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p><em>TinyExpr++</em> is self-contained in two files: <code>tinyexpr.cpp</code> and <code>tinyexpr.h</code>. To use <em>TinyExpr++</em>, add those files to your project.</p>
283
+
<p><em>TinyExpr++</em> is self-contained in two files: “tinyexpr.cpp” and “tinyexpr.h”. To use <em>TinyExpr++</em>, add those files to your project.</p>
284
284
<p>The API documentation can be built using the following:</p>
<li>single line comments (everything after a <code>//</code> until the end of the current line).</li>
315
315
</ul>
316
316
<p>For example, assuming that the variables <code>P_LEVEL</code> and <code>N_OBS</code> have been defined within the parser, an expression such as this could be used:</p>
317
-
<divclass="sourceCode" id="cb1"><preclass="sourceCode cpp code-with-copy"><codeclass="sourceCode cpp"><spanid="cb1-1"><ahref="#cb1-1" aria-hidden="true" tabindex="-1"></a><spanclass="co">/* Returns the p-level of a study if:</span></span>
<spanid="cb1-6"><ahref="#cb1-6" aria-hidden="true" tabindex="-1"></a>IF<spanclass="op">(</span><spanclass="co">// Review the results from the analysis</span></span>
<spanid="cb1-10"><ahref="#cb1-10" aria-hidden="true" tabindex="-1"></a><spanclass="co">// or NaN if not</span></span>
327
-
<spanid="cb1-11"><ahref="#cb1-11" aria-hidden="true" tabindex="-1"></a> NAN<spanclass="op">)</span></span></code><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></pre></div>
317
+
<divclass="sourceCode" id="annotated-cell-1"><preclass="sourceCode cpp code-annotation-code code-with-copy code-annotated"><codeclass="sourceCode cpp"><spanid="annotated-cell-1-1"><ahref="#annotated-cell-1-1" aria-hidden="true" tabindex="-1"></a><spanclass="co">/* Returns the p-level of a study if:</span></span>
<spanid="annotated-cell-1-3"><ahref="#annotated-cell-1-3" aria-hidden="true" tabindex="-1"></a><spanclass="co"> number of observations was at least 30.</span></span>
320
+
<aclass="code-annotation-anchor" data-target-cell="annotated-cell-1" data-target-annotation="1" onclick="event.preventDefault();">1</a><spanid="annotated-cell-1-4" class="code-annotation-target"><ahref="#annotated-cell-1-4" aria-hidden="true" tabindex="-1"></a><spanclass="co"> Otherwise, NaN is returned. */</span></span>
<spanid="annotated-cell-1-6"><ahref="#annotated-cell-1-6" aria-hidden="true" tabindex="-1"></a>IF<spanclass="op">(</span><spanclass="co">// Review the results from the analysis</span></span>
<spanid="annotated-cell-1-8"><ahref="#annotated-cell-1-8" aria-hidden="true" tabindex="-1"></a><spanclass="co">// ...and return the p-level if acceptable</span></span>
<spanid="cb1-14"><ahref="#cb1-14" aria-hidden="true" tabindex="-1"></a><spanclass="dt">double</span> x<spanclass="op">{</span><spanclass="dv">0</span><spanclass="op">},</span> y<spanclass="op">{</span><spanclass="dv">0</span><spanclass="op">};</span><spanclass="co">// x and y are bound at eval-time.</span></span>
336
+
<spanid="cb1-14"><ahref="#cb1-14" aria-hidden="true" tabindex="-1"></a><spanclass="dt">te_type</span> x<spanclass="op">{</span><spanclass="dv">0</span><spanclass="op">},</span> y<spanclass="op">{</span><spanclass="dv">0</span><spanclass="op">};</span><spanclass="co">// x and y are bound at eval-time.</span></span>
337
337
<spanid="cb1-15"><ahref="#cb1-15" aria-hidden="true" tabindex="-1"></a><spanclass="co">// Store variable names and pointers.</span></span>
<spanid="cb2-3"><ahref="#cb2-3" aria-hidden="true" tabindex="-1"></a><spanclass="co">/* Example function that adds two numbers together. */</span></span>
364
364
<spanid="cb2-4"><ahref="#cb2-4" aria-hidden="true" tabindex="-1"></a><spanclass="cf">return</span> a <spanclass="op">+</span> b<spanclass="op">;</span></span>
<spanid="cb4-7"><ahref="#cb4-7" aria-hidden="true" tabindex="-1"></a><spanclass="op">};</span></span></code><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></pre></div>
397
397
<p>Next, create two functions that can accept this object and perform actions on it. (Note that proper error handling is not included for brevity.):</p>
398
398
<divclass="sourceCode" id="cb5"><preclass="sourceCode cpp code-with-copy"><codeclass="sourceCode cpp"><spanid="cb5-1"><ahref="#cb5-1" aria-hidden="true" tabindex="-1"></a><spanclass="co">// Returns the value of a cell from the object's data.</span></span>
0 commit comments