Sha256: 752d4f60bf94ad9ad371d8cb075c67f62744a75d93574e245e311f075dbf9a90

Contents?: true

Size: 180 Bytes

Versions: 5

Compression:

Stored size: 180 Bytes

Contents

function g(x) {
    if ((x & 1) == 1) return 1;
    return 2;
}

function f(n) {
    var q = 0;
    for (var i = 0; i < n; i++)
        q += g(i);
    return q;
}

print(f(1000));

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
johnson-2.0.0.pre0 vendor/tracemonkey/call.js
smparkes-johnson-1.1.2.6 vendor/tracemonkey/call.js
smparkes-johnson-1.1.2.5 vendor/tracemonkey/call.js
smparkes-johnson-1.1.2.4 vendor/tracemonkey/call.js
smparkes-johnson-1.1.2.3 vendor/tracemonkey/call.js