Jensen's Device: Difference between revisions

Content added Content deleted
(Grouping BASIC dialects)
(Added Asymptote)
Line 260: Line 260:


</syntaxhighlight>
</syntaxhighlight>

=={{header|Arturo}}==
=={{header|Arturo}}==
{{trans|Ruby}}
{{trans|Ruby}}
Line 269: Line 270:
]
]
print ["harmonicSum 1->100:" harmonicSum 'i 1 100 {1.0 / i}]</syntaxhighlight>
print ["harmonicSum 1->100:" harmonicSum 'i 1 100 {1.0 / i}]</syntaxhighlight>

{{out}}
{{out}}

<pre>harmonicSum 1->100: 5.187377517639621</pre>
<pre>harmonicSum 1->100: 5.187377517639621</pre>

=={{header|Asymptote}}==
{{trans|FreeBASIC}}
<syntaxhighlight lang="Asymptote">real temp = 0;
for(int i = 1; i <= 100; ++i) {
temp += 1/i;
}
write(temp);</syntaxhighlight>
{{out}}
<pre>5.18737751763962</pre>


=={{header|AWK}}==
=={{header|AWK}}==