1# generated from the original tests.
2# Henceforth it may be nicer to group tests into separate files.
3-- in.cue --
4import "math"
5
6mul0: math.MultipleOf(4, 2)
7mul1: math.MultipleOf(5, 2)
8// TODO(errors): ensure path is included for the following error.
9mul2: math.MultipleOf(5, 0)
10mul3: math.MultipleOf(100, 1.00001)
11mul4: math.MultipleOf(1, 1)
12mul5: math.MultipleOf(5, 2.5)
13mul6: math.MultipleOf(100e100, 10)
14mul7: 10
15mul7: math.MultipleOf(2)
16mul8: 9 & math.MultipleOf(3)
17
18r0: math.Round(2.5)
19r1: math.Round(-2.5)
20r2: math.RoundToEven(2.5)
21r3: math.RoundToEven(-2.5)
22
23floorE1: math.Floor(3, 5)
24floorE2: math.Floor("foo")
25
26floor0: math.Floor(math.Pi)
27floor1: math.Floor(2.9)
28floor2: math.Floor(-2.2)
29floor3: math.Floor(2900)
30floor4: math.Floor(29e2)
31
32ceil0: math.Ceil(2.5)
33ceil1: math.Ceil(-2.2)
34
35trunc0: math.Trunc(2.5)
36trunc1: math.Trunc(-2.9)
37-- out/math --
38Errors:
39mul2: error in call to math.MultipleOf: division by zero:
40 ./in.cue:6:7
41floorE1: too many arguments in call to math.Floor (have 2, want 1):
42 ./in.cue:20:10
43floorE2: cannot use "foo" (type string) as number in argument 1 to math.Floor:
44 ./in.cue:21:21
45
46Result:
47mul0: true
48mul1: false
49// TODO(errors): ensure path is included for the following error.
50mul2: _|_ // mul2: error in call to math.MultipleOf: division by zero
51mul3: false
52mul4: true
53mul5: true
54mul6: true
55mul7: 10
56mul8: 9
57r0: 3
58r1: -3
59r2: 2
60r3: -2
61floorE1: _|_ // floorE1: too many arguments in call to math.Floor (have 2, want 1)
62floorE2: _|_ // floorE2: cannot use "foo" (type string) as number in argument 1 to math.Floor
63floor0: 3
64floor1: 2
65floor2: -3
66floor3: 2900
67floor4: 2900
68ceil0: 3
69ceil1: -2
70trunc0: 2
71trunc1: -2