github.com/solo-io/cue@v0.4.7/cue/testdata/resolve/006_arithmetic.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: arithmetic
     4  #evalPartial
     5  -- in.cue --
     6  v1: 1.0T / 2.0
     7  v2: 2.0 == 2
     8  n1: 1
     9  v5: 2.0 / n1
    10  v6: 1.0 / 1.0
    11  e2: int & 4.0/2.0
    12  -- out/def --
    13  v1: 5.0000000000e+11
    14  v2: true
    15  n1: 1
    16  v5: 2.0
    17  v6: 1.
    18  e2: _|_ // conflicting values int and (4.0 / 2.0) (mismatched types int and float)
    19  -- out/legacy-debug --
    20  <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))}
    21  -- out/compile --
    22  --- in.cue
    23  {
    24    v1: (1000000000000 / 2.0)
    25    v2: (2.0 == 2)
    26    n1: 1
    27    v5: (2.0 / 〈0;n1〉)
    28    v6: (1.0 / 1.0)
    29    e2: (int & (4.0 / 2.0))
    30  }
    31  -- out/eval --
    32  Errors:
    33  e2: conflicting values int and 2 (mismatched types int and float):
    34      ./in.cue:6:5
    35      ./in.cue:6:11
    36  
    37  Result:
    38  (_|_){
    39    // [eval]
    40    v1: (float){ 5.0000000000E+11 }
    41    v2: (bool){ true }
    42    n1: (int){ 1 }
    43    v5: (float){ 2.0 }
    44    v6: (float){ 1 }
    45    e2: (_|_){
    46      // [eval] e2: conflicting values int and 2 (mismatched types int and float):
    47      //     ./in.cue:6:5
    48      //     ./in.cue:6:11
    49    }
    50  }