1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| /*
| * harmonic.js
| *
| */
|
| import {terminal} from "./dfhi.js";
|
| window.main = function(...argv) {
| const n = Number.parseInt(argv[0]);
| let h = 0;
| for(let i = 1; i <=n; ++i) {
| h += 1/i;
| }
| terminal.printl(`H_${n} = ${h}`);
| };
|
|