# 運算子

```    // left-hand unary operators
<operator> <operand> // operand is an expression

// right-hand unary operators
<operand> <operator> // operand is an expression
@{LobbyBeacon.endUserIDs._experience.emailid.id} is not null

// binary operators
<operand1> <operator> <operand2>

```

## 邏輯

```<expression1>和<expression2>

```
<expression1>和<expression2>都必須是布林值。 結果是布爾型的。
```3.14 > 2和3.15 < 1

```
```<expression1>或<expression2>

```
<expression1>和<expression2>都必須是布林值。

```3.14 > 2或3.15 < 1

```
not
```not <expression>

```
<expression>必須是布林值。

```不是3.15 < 1

```

## 比較

```<expression>為空

```

```@{BarBeacon.location}為null

```

```<expression>非null

```

```@不為空

```

```<expression>包含空值

```
<expression>必須是清單。

```["foo", "bar",null]具有空值

```

```["foo"、"bar"、""有空值

```

==
```<expression1> == <expression2>

```
<expression1>和<expression2>必須具有相同的資料類型。

```3.14 == 42

```
```"foo" == "bar"

```
!=
```<expression1> != <expression2>

```
<expression1>和<expression2>必須具有相同的資料類型。

```3.14 != 42

```
```"foo" != "bar"

```
>
```<expression1> > <expression2>

```

Datetimeonly可與Datetimeonly比較。

```3.14 > 42

```
>=
```<expression1> >= <expression2>

```

Datetimeonly可與Datetimeonly比較。

```42 >= 3.14

```
<
```<expression1> < <expression2>

```

Datetimeonly可與Datetimeonly比較。

```42 < 3.14

```
<=
```<expression1> <= <expression2>

```

Datetimeonly可與Datetimeonly比較。

```42 <= 3.14

```

## 算術

+
```<expression1> + <expression2>

```

```1 + 2

```

-
```<expression1> - <expression2>

```

```2 - 1

```

/
```<expression1> / <expression2>

```

<expression2>不能等於0（傳回0）。
```4 / 2

```

*
```<expression1> * <expression2>

```

```3 * 4

```

%
```<expression1> % <expression2>

```

```3 % 2

```

## 數學

```<expression>是數字

```

```@是數字

```

```<expression>為整數

```

```@是整數

```

```<expression>小數

```

```@是小數

```

## String

+
```<string> + <expression>

```
```<expression> + <string>

```

```"當前時間是" +(now()))

```

```(now())+ "是目前時間"

```

```"a" + "b" + "c" + 1234

```

## 日期

+
```<expression + <duration>

```

```toDateTime("2011-12-03T15:15:30Z")

```
``` + toDuration("PT15M")

```

```toDateTimeOnly("2011-12-03T15:15:30")

```
``` + toDuration("PT15M")

```

```now()+ toDuration("PT1H")

```

```toDuration("PT1H")+ toDuration("PT1H")

```