Numerical integration: Difference between revisions

(→‎{{header|J}}: Extend examples)
Line 879:
0 p.. 0 0 1x NB. or using rationals
0 0 0 1r3</lang>
That is: <math>0x^0 + 1x^1 + 0x^2 + 0.3333x^3</math><br>
So to integrate <math>x^2</math> from 0 to pi:
<lang j> 0 0 1 (0&p..@[ -~/@:p. ]) 0 1p1
10.3354255601</lang>
 
=={{header|Java}}==
Anonymous user