summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/Math.floor.js
blob: c636398969d5721b6fe219eece539394ea046a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
load("test-common.js");

try {
    assert(Math.floor(0.95) === 0);
    assert(Math.floor(4) === 4);
    assert(Math.floor(7.004) == 7);
    assert(Math.floor(-0.95) === -1);
    assert(Math.floor(-4)    === -4);
    assert(Math.floor(-7.004) === -8);

    assert(isNaN(Math.floor()));
    assert(isNaN(Math.floor(NaN)));

    assert(Math.floor.length === 1);

    console.log("PASS");
} catch (e) {
    console.log("FAIL: " + e);
}