Jump to content

Numerical integration: Difference between revisions

→‎{{header|ALGOL 68}}: fix right rect to go all the way to b, not b-h
(→‎{{header|Perl 6}}: update to new testing regime)
(→‎{{header|ALGOL 68}}: fix right rect to go all the way to b, not b-h)
Line 188:
 
=={{header|ALGOL 68}}==
{{incorrect|ALGOL 68|right rect stops one h too soon; mid rect doesn't sample at midpoints but merely recreates trapezium differently.}}
<lang algol68>MODE F = PROC(LONG REAL)LONG REAL;
 
Line 216 ⟶ 215:
LONG REAL sum:= 0;
LONG REAL x:= a + h;
WHILE x <= b - h DO
sum := sum + (h * f(x));
x +:= h
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.