Numerical integration: Difference between revisions

Content added Content deleted
m (→‎{{header|PureBasic}}: Update & fix)
m (→‎{{header|PureBasic}}: fixed typo...)
Line 1,425: Line 1,425:
Procedure.d RightItegral(Start, Stop, Steps, *func.TestFunction)
Procedure.d RightItegral(Start, Stop, Steps, *func.TestFunction)
Protected.d n=(Stop-Start)/Steps, sum, x=Start
Protected.d n=(Stop-Start)/Steps, sum, x=Start
While x+n <= Stop
While x < Stop
x + n
x + n
sum + n * *func(x)
sum + n * *func(x)
Line 1,473: Line 1,473:
Debug Simpson (1,100,1000,@Test2())</lang>
Debug Simpson (1,100,1000,@Test2())</lang>
<pre>0.2353220100000005
<pre>0.2353220100000005
0.25502500000000056
0.24502500000000052
0.25002500000000044
0.25002500000000044
0.25000000000000006
0.25000000000000006


4.6540000764434195
4.6540000764434195
4.5569810575146832
4.5559910575146834
4.6059860575146745
4.6059860575146745
4.6051703849571446</pre>
4.6051703849571446</pre>