Numerical integration: Difference between revisions

Content added Content deleted
(Updated to work with Nim 1.4: replaced ".. <" with "..<", added a space before "x". Updated result.)
m (Formatting.)
Line 3,501: Line 3,501:
echo " from ", a, " to ", b, " (", steps, " steps) = ",
echo " from ", a, " to ", b, " (", steps, " steps) = ",
integrate(fun, float(a), float(b), steps, rule)</lang>
integrate(fun, float(a), float(b), steps, rule)</lang>

Output:
{{out}}
<pre>cube integrated using leftRect
<pre>cube integrated using leftRect
from 0 to 1 (100 steps) = 0.245025
from 0 to 1 (100 steps) = 0.245025