> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/more-details/applications/application-modules/compare.md).

# Compare

> Compare a with b and emit a boolean.

Compares `a` with `b` under `operator`. `tolerance` widens equality for floats, where exact equality is rarely what was meant.

## At a glance

|                          |                              |
| ------------------------ | ---------------------------- |
| Module type              | `Compare`                    |
| Category                 | Primitives · Scalar and json |
| Default tier             | `reactive`                   |
| Runs on                  | `reactive`, `durable`        |
| Starts a flow            | no                           |
| Holds a body             | no                           |
| Keeps state between runs | no                           |
| Available in             | every application type       |

## Parameters

### `operator`

`"=" | "!=" | "<" | "<=" | ">" | ">="` · required · defaults to `"="`

The comparison applied to `a` and `b`.

### `tolerance`

`number | null` · required · defaults to `null`

Widens equality by this much, for floats where exact equality is rarely meant.

## Inputs

| Port | Kind     | Required | Description                                                                                                                           |
| ---- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `on` | `event`  | no       | Implicit on every module that does not itself start a flow: wire an event here to make this module the start of what that event runs. |
| `a`  | `scalar` | yes      | The left-hand value.                                                                                                                  |
| `b`  | `scalar` | yes      | The right-hand value.                                                                                                                 |

## Outputs

| Port     | Kind              | Connects to                        | Description                  |
| -------- | ----------------- | ---------------------------------- | ---------------------------- |
| `result` | `scalar<boolean>` | `scalar`, `json`, `text`, `signal` | Whether the comparison held. |

***

[← All application modules](/more-details/applications/application-modules.md)
