Jump to content

Jensen's Device: Difference between revisions

added AWK
m (Fix pascal version to run in delphi)
(added AWK)
Line 260:
 
</lang>
=={{header|AWK}}==
 
<lang AWK>
# syntax: GAWK -f JENSENS_DEVICE.AWK
# converted from FreeBASIC
BEGIN {
evaluation()
exit(0)
}
function evaluation( hi,i,lo,tmp) {
lo = 1
hi = 100
for (i=lo; i<=hi; i++) {
tmp += (1/i)
}
printf("%.15f\n",tmp)
}
</lang>
{{out}}
<pre>
5.187377517639621
</pre>
 
=={{header|BASIC256}}==
477

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.