-
Notifications
You must be signed in to change notification settings - Fork 10
/
lt.ahk
46 lines (33 loc) · 866 Bytes
/
lt.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
lt(param_value, param_other) {
if (!this.isNumber(param_value) || !this.isNumber(param_other)) {
this._internal_ThrowException()
}
; create
if (param_value < param_other) {
return true
}
return false
}
; tests
assert.true(A.lt(1, 3))
assert.false(A.lt(3, 3))
assert.false(A.lt(3, 1))
; omit
assert.label("equal numbers")
assert.false(A.lt(1, 1))
assert.label("smaller first number")
assert.true(A.lt(1, 2))
assert.label("zero as first number")
assert.true(A.lt(0, 1))
assert.label("zero as second number")
assert.false(A.lt(1, 0))
assert.label("negative numbers")
assert.false(A.lt(-1, -2))
assert.label("negative and positive number")
assert.true(A.lt(-1, 1))
assert.label("fractions")
assert.false(A.lt(0.5, 0.2))
assert.label("equal fractions")
assert.false(A.lt(0.5, 0.5))
assert.label("large numbers")
assert.false(A.lt(1000000, 999999))