| # DO NOT EDIT; generated by go run testdata/gen.go |
| # |
| #name: integer-specific arithmetic |
| #evalPartial |
| -- in.cue -- |
| q1: 5 quo 2 // 2 |
| q2: 5 quo -2 // -2 |
| q3: -5 quo 2 // -2 |
| q4: -5 quo -2 // 2 |
| qe1: 2.0 quo 1 |
| qe2: 2 quo 1.0 |
| |
| r1: 5 rem 2 // 1 |
| r2: 5 rem -2 // 1 |
| r3: -5 rem 2 // -1 |
| r4: -5 rem -2 // -1 |
| re1: 2.0 rem 1 |
| re2: 2 rem 1.0 |
| |
| d1: 5 div 2 // 2 |
| d2: 5 div -2 // -2 |
| d3: -5 div 2 // -3 |
| d4: -5 div -2 // 3 |
| de1: 2.0 div 1 |
| de2: 2 div 1.0 |
| |
| m1: 5 mod 2 // 1 |
| m2: 5 mod -2 // 1 |
| m3: -5 mod 2 // 1 |
| m4: -5 mod -2 // 1 |
| me1: 2.0 mod 1 |
| me2: 2 mod 1.0 |
| -- out/def -- |
| q1: 2 |
| q2: -2 |
| q3: -2 |
| q4: 2 |
| qe1: _|_ // invalid operation 2.0 quo 1 (mismatched types float and int) |
| qe2: _|_ // invalid operation 2 quo 1.0 (mismatched types int and float) |
| r1: 1 |
| r2: 1 |
| r3: -1 |
| r4: -1 |
| re1: _|_ // invalid operation 2.0 rem 1 (mismatched types float and int) |
| re2: _|_ // invalid operation 2 rem 1.0 (mismatched types int and float) |
| d1: 2 |
| d2: -2 |
| d3: -3 |
| d4: 3 |
| de1: _|_ // invalid operation 2.0 div 1 (mismatched types float and int) |
| de2: _|_ // invalid operation 2 div 1.0 (mismatched types int and float) |
| m1: 1 |
| m2: 1 |
| m3: 1 |
| m4: 1 |
| me1: _|_ // invalid operation 2.0 mod 1 (mismatched types float and int) |
| me2: _|_ // invalid operation 2 mod 1.0 (mismatched types int and float) |
| -- out/legacy-debug -- |
| <0>{q1: 2, q2: -2, q3: -2, q4: 2, qe1: _|_((2.0 quo 1):invalid operation 2.0 quo 1 (mismatched types float and int)), qe2: _|_((2 quo 1.0):invalid operation 2 quo 1.0 (mismatched types int and float)), r1: 1, r2: 1, r3: -1, r4: -1, re1: _|_((2.0 rem 1):invalid operation 2.0 rem 1 (mismatched types float and int)), re2: _|_((2 rem 1.0):invalid operation 2 rem 1.0 (mismatched types int and float)), d1: 2, d2: -2, d3: -3, d4: 3, de1: _|_((2.0 div 1):invalid operation 2.0 div 1 (mismatched types float and int)), de2: _|_((2 div 1.0):invalid operation 2 div 1.0 (mismatched types int and float)), m1: 1, m2: 1, m3: 1, m4: 1, me1: _|_((2.0 mod 1):invalid operation 2.0 mod 1 (mismatched types float and int)), me2: _|_((2 mod 1.0):invalid operation 2 mod 1.0 (mismatched types int and float))} |
| -- out/compile -- |
| --- in.cue |
| { |
| q1: (5 quo 2) |
| q2: (5 quo -2) |
| q3: (-5 quo 2) |
| q4: (-5 quo -2) |
| qe1: (2.0 quo 1) |
| qe2: (2 quo 1.0) |
| r1: (5 rem 2) |
| r2: (5 rem -2) |
| r3: (-5 rem 2) |
| r4: (-5 rem -2) |
| re1: (2.0 rem 1) |
| re2: (2 rem 1.0) |
| d1: (5 div 2) |
| d2: (5 div -2) |
| d3: (-5 div 2) |
| d4: (-5 div -2) |
| de1: (2.0 div 1) |
| de2: (2 div 1.0) |
| m1: (5 mod 2) |
| m2: (5 mod -2) |
| m3: (-5 mod 2) |
| m4: (-5 mod -2) |
| me1: (2.0 mod 1) |
| me2: (2 mod 1.0) |
| } |
| -- out/eval -- |
| Errors: |
| qe1: invalid operands 2.0 and 1 to 'quo' (type float and int): |
| ./in.cue:5:6 |
| ./in.cue:5:14 |
| qe2: invalid operands 2 and 1.0 to 'quo' (type int and float): |
| ./in.cue:6:6 |
| ./in.cue:6:12 |
| re1: invalid operands 2.0 and 1 to 'rem' (type float and int): |
| ./in.cue:12:6 |
| ./in.cue:12:14 |
| re2: invalid operands 2 and 1.0 to 'rem' (type int and float): |
| ./in.cue:13:6 |
| ./in.cue:13:12 |
| de1: invalid operands 2.0 and 1 to 'div' (type float and int): |
| ./in.cue:19:6 |
| ./in.cue:19:14 |
| de2: invalid operands 2 and 1.0 to 'div' (type int and float): |
| ./in.cue:20:6 |
| ./in.cue:20:12 |
| me1: invalid operands 2.0 and 1 to 'mod' (type float and int): |
| ./in.cue:26:6 |
| ./in.cue:26:14 |
| me2: invalid operands 2 and 1.0 to 'mod' (type int and float): |
| ./in.cue:27:6 |
| ./in.cue:27:12 |
| |
| Result: |
| (_|_){ |
| // [eval] |
| q1: (int){ 2 } |
| q2: (int){ -2 } |
| q3: (int){ -2 } |
| q4: (int){ 2 } |
| qe1: (_|_){ |
| // [eval] qe1: invalid operands 2.0 and 1 to 'quo' (type float and int): |
| // ./in.cue:5:6 |
| // ./in.cue:5:14 |
| } |
| qe2: (_|_){ |
| // [eval] qe2: invalid operands 2 and 1.0 to 'quo' (type int and float): |
| // ./in.cue:6:6 |
| // ./in.cue:6:12 |
| } |
| r1: (int){ 1 } |
| r2: (int){ 1 } |
| r3: (int){ -1 } |
| r4: (int){ -1 } |
| re1: (_|_){ |
| // [eval] re1: invalid operands 2.0 and 1 to 'rem' (type float and int): |
| // ./in.cue:12:6 |
| // ./in.cue:12:14 |
| } |
| re2: (_|_){ |
| // [eval] re2: invalid operands 2 and 1.0 to 'rem' (type int and float): |
| // ./in.cue:13:6 |
| // ./in.cue:13:12 |
| } |
| d1: (int){ 2 } |
| d2: (int){ -2 } |
| d3: (int){ -3 } |
| d4: (int){ 3 } |
| de1: (_|_){ |
| // [eval] de1: invalid operands 2.0 and 1 to 'div' (type float and int): |
| // ./in.cue:19:6 |
| // ./in.cue:19:14 |
| } |
| de2: (_|_){ |
| // [eval] de2: invalid operands 2 and 1.0 to 'div' (type int and float): |
| // ./in.cue:20:6 |
| // ./in.cue:20:12 |
| } |
| m1: (int){ 1 } |
| m2: (int){ 1 } |
| m3: (int){ 1 } |
| m4: (int){ 1 } |
| me1: (_|_){ |
| // [eval] me1: invalid operands 2.0 and 1 to 'mod' (type float and int): |
| // ./in.cue:26:6 |
| // ./in.cue:26:14 |
| } |
| me2: (_|_){ |
| // [eval] me2: invalid operands 2 and 1.0 to 'mod' (type int and float): |
| // ./in.cue:27:6 |
| // ./in.cue:27:12 |
| } |
| } |