Numerical integration: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: added a missing statement.)
Line 4,252: Line 4,252:
trapezium: procedure expose test; parse arg a,b,n; h=(b-a)/n
trapezium: procedure expose test; parse arg a,b,n; h=(b-a)/n
$= 0
$= 0
do x=a by h for n; $=$+(f(x)+f(x+h)); end /*x*/</lang>
do x=a by h for n; $=$+(f(x)+f(x+h)); end /*x*/
return $*h/2</lang>
{{out|output|text=&nbsp; when using the default inputs:}}
{{out|output|text=&nbsp; when using the default inputs:}}
<pre>
<pre>