operator | description | example |
---|---|---|
+ | Addition | 1 + 1 |
- | Subtraction | 2 - 3 |
* | Multiplication | 3 * 3 |
/ | Division | 8 / 4 |
result_field_name: field_name + const - spec_field_name.eval * const
Notes:
2.5
.spec_field_name.eval
returns a result of type number.Arithmetic operations require a working knowledge of references. For more on how references work see the References Section.
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
int_step | add_one | multiply_two | add_all |
---|---|---|---|
2 | 3 | 6 | 11 |
4 | 5 | 10 | 19 |
6 | 7 | 14 | 27 |
8 | 9 | 18 | 35 |
[
{
"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
}
]