Operators (Arithmetic)
Arithmetic
Numeric Operations: Add, Subtract, Multiply, Divide
Using CUE references on non-constant values in arithmetic and string operations will result in unexpected results since the process generates a new value for each iteration based on the field type

If a single term in an operation with references is a value reference, then all other terms will be treated as a value reference (require a full path name)

Operators
operator description example + Addition 1 + 1 - Subtraction 2 - 3 * Multiplication 3 * 3 / Division 8 / 4

Usage
```
result_field_name: field_name + const - spec_field_name.eval * const
```

Notes:

field_name represents a previously declared constant field of type number.
const represents a constant such as the number `2.5`

.
Reference `spec_field_name.eval`

returns a result of type number.
Order matters when referencing fields. An arithmetic operation must come after all the specifications it references.
References
Arithmetic operations require a working knowledge of references. For more on how references work see the References Section .

Arithmetic operations only work with numeric types.
Examples
Number Step with Arithmetic Operations
```
int_step: #SpecNumberStep & {
value: 2
step: 2
}
add_one: int_step.eval + 1
multiply_two: add_one.eval * 2
add_all: int_step.eval + add_one + multiply_two
```

CSV Example Output
int_step add_one multiply_two add_all 2 3 6 11 4 5 10 19 6 7 14 27 8 9 18 35

JSON Example Output
```
[
{
"int_step": 2,
"add_one": 3,
"multiply_two": 6,
"add_all": 11
},
{
"int_step": 4,
"add_one": 5,
"multiply_two": 10,
"add_all": 19
},
{
"int_step": 6,
"add_one": 7,
"multiply_two": 14,
"add_all": 27
},
{
"int_step": 11,
"add_one": 19,
"multiply_two": 27,
"add_all": 35
}
]
```