Sum of a series: Difference between revisions

Line 172:
Alternatively, get Mathematica to do the whole calculation in floating point by using a floating point value in the formula:
Sum[1./x^2, {x, 1, 1000}]
 
=={{header|MAXScript}}==
<pre>total = 0
for i in 1 to 1000 do
(
total += 1.0 / pow i 2
)
print total</pre>
 
=={{header|OCaml}}==
Anonymous user