# Compare operations

Pulsar supports compare operations such as `<`,`>`,`==` and others but the syntax is a bit different than in other languages. Instead of operators, you use [functions](https://supernova-developers.gitbook.io/supernova-dsm/pulsar-language/functions):

```
{[ if @is.gt(var1, var2) ]}
  Executes when var1 > var2
{[/]}
```

The following compare functions are available:

### is.gt

`is.gt` results to true when argument 1 is greater than argument 2.

```
{[ if @is.gt(arg1, arg2) ]}
  Executes when arg1 > arg2
{[/]}
```

### is.lt

`is.gt` results to true when argument 1 is less than argument 2.

```
{[ if @is.lt(arg1, arg2) ]}
  Executes when arg1 < arg2
{[/]}
```

### is.nil

`is.nil` results to true when argument 1 is nil. Note that  value of`nil` is not the same as `not defined`! For example, retrieving detail about a specific screen that didn't exist produces nil, however not defining the variable is completely different

```
{[ if @is.nil(arg1) ]}
  Executes when arg1 is nil
{[/]}
```

### is.defined

`is.defined` results to true when argument 1 is undefined. Undefined variables were never defined in the current context (or in global context). Note that defined variables which are `nil` will result in `false`.

```
{[ if @is.defined(arg1) ]}
  Executes when arg1 was defined in current scope
{[/]}
```

### is.equals

`is.equals` results to true when both arguments are equal. Note that this means they have the same value (but don't necessarily have to have the same data type, such as `Double` and `Integer` defined number `1`).&#x20;

```
{[ if @is.equals(myNumber, 1) ]}
  Executes when myNumber == 1
{[/]}
```

### iif

Ternary function `iif` can be used to evaluate a boolean statement and then use one of two declared results:

```
{[ var myVariable @iif(@is.equals(textVariable, "Test"), 1, 2) ]}
```

In the example above, the statement (`@is.equals(textVariable, "Test")`) is evaluated. When `true`, `myVariable` is defined as `1`, while when resulting to `false`, `myVariable` is defined as `2`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://supernova-developers.gitbook.io/supernova-dsm/pulsar-language/flows/if-else-if-else/compare-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
