Jensen's Device: Difference between revisions

Content added Content deleted
(Jensen's Device en BASIC256)
(Added 11l)
Line 32: Line 32:
[[wp:Donald_Knuth|Donald Knuth]] later proposed the [[Man or boy test|Man or Boy Test]] as a more rigorous exercise.
[[wp:Donald_Knuth|Donald Knuth]] later proposed the [[Man or boy test|Man or Boy Test]] as a more rigorous exercise.
<br><br>
<br><br>

=={{header|11l}}==
{{trans|C#}}

<lang 11l>F sum(&i, lo, hi, term)
V temp = 0.0
i = lo
L i <= hi
temp += term()
i++
R temp

F main()
Int i
print(sum(&i, 1, 100, () -> 1 / @i))

main()</lang>

{{out}}
<pre>
5.18738
</pre>


=={{header|Ada}}==
=={{header|Ada}}==