cuelang.org/go@v0.13.0/cue/testdata/resolve/006_arithmetic.txtar (about)

     1  #name: arithmetic
     2  #evalPartial
     3  -- in.cue --
     4  v1: 1.0T / 2.0
     5  v2: 2.0 == 2
     6  n1: 1
     7  v5: 2.0 / n1
     8  v6: 1.0 / 1.0
     9  e2: int & 4.0/2.0
    10  -- out/def --
    11  v1: 5.0000000000e+11
    12  v2: true
    13  n1: 1
    14  v5: 2.0
    15  v6: 1.
    16  e2: _|_ // conflicting values int and (4.0 / 2.0) (mismatched types int and float)
    17  -- out/legacy-debug --
    18  <0>{v1: 5.0000000000e+11, v2: true, n1: 1, v5: 2.0, v6: 1., e2: _|_((int & (4.0 / 2.0)):conflicting values int and (4.0 / 2.0) (mismatched types int and float))}
    19  -- out/compile --
    20  --- in.cue
    21  {
    22    v1: (1000000000000 / 2.0)
    23    v2: (2.0 == 2)
    24    n1: 1
    25    v5: (2.0 / 〈0;n1〉)
    26    v6: (1.0 / 1.0)
    27    e2: (int & (4.0 / 2.0))
    28  }
    29  -- out/eval/stats --
    30  Leaks:  0
    31  Freed:  7
    32  Reused: 5
    33  Allocs: 2
    34  Retain: 0
    35  
    36  Unifications: 7
    37  Conjuncts:    8
    38  Disjuncts:    7
    39  -- out/eval --
    40  Errors:
    41  e2: conflicting values int and 2.0 (mismatched types int and float):
    42      ./in.cue:6:5
    43      ./in.cue:6:11
    44  
    45  Result:
    46  (_|_){
    47    // [eval]
    48    v1: (float){ 5.0E+11 }
    49    v2: (bool){ true }
    50    n1: (int){ 1 }
    51    v5: (float){ 2.0 }
    52    v6: (float){ 1.0 }
    53    e2: (_|_){
    54      // [eval] e2: conflicting values int and 2.0 (mismatched types int and float):
    55      //     ./in.cue:6:5
    56      //     ./in.cue:6:11
    57    }
    58  }