Inbuilt Operators
Using Operators
Journey Programming Language supports the following built-in operators so that you can perform some calculations dynamically
Binary
Arithmetic
Interpreter smartly converts DataType of Input to Most Supportive Data Type Without Data Loss before conversion when both DataType Are not Same
- - Double
- - Integer
- - PositiveInteger
Syntax
<Expression> <Binary Arithmatic Operator> <Expression>
Options
- - Binary Aritnmatic Operator: Valid values +, -, /, *, %
Examples
a + b
3 - 2
b / 5
c * 4
Equality
Interpreter smartly converts DataType of Input to Most Supportive Data Type Without Data Loss before conversion when both DataType Are not Same
- - Double
- - Integer
- - PositiveInteger
Syntax
<Expression> <Binary Equality Operator> <Expression>
Options
- - Binary Equality Operator: Valid values >, >=, <, <=, ==, !=
Examples
a < b
a <= b
a > b
a >= b
a == b
a != b
Logical
Interpreter smartly converts DataType of Input to Most Optimistic Data Type Without Data Loss in the following manner
- 0 => false
- 0.0 => false
- non-zero-number => true
- true => true
- false => false
- "true" => true
- "false" => false
- "<Any Other String>" => true
- null => false
- anything else => true
Syntax
<Expression> <Binary Logical Operator> <Expression>
Options
- - Binary Logical Operator: Valid values &&, ||
Examples
a && b
3 || 2
b && 5
c || 4
Unary
Arithmetic
Syntax
<Expression><Unary Arithmatic Operator>
Options
- - Unary Aritnmatic Operator: Valid values ++, --
Examples
a++
b--
Logical
Interpreter smartly converts DataType of Input to Most Optimistic Data Type Without Data Loss the following manner
- 0 => false
- 0.0 => false
- non-zero-number => true
- true => true
- false => false
- "true" => true
- "false" => false
- "<Any Other String>" => true
- null => false
- anything else => true
Syntax
<Unary Logical Operator> <Expression>
Options
- - Unary Logical Operator: Valid values !
Examples
!a