---
title: "gt"
description: "True when `a` is greater than `b`."
group: "space"
groupTitle: "Shapes, frames & warps"
categoryId: "math"
categorySlug: "math"
categoryTitle: "Math"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/math.ts#L463"
---

# gt

True when `a` is greater than `b`.

```ts
gt(a: Val, b: Val): Expr
```

Import `math` from `shaders/std` and use `math.gt`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `a` | `Val` |  |
| `b` | `Val` |  |

## Example

```ts
const highlights = select(gt(luma, 0.5), luma, 0)
```

## See also

- [`ge`](/docs/primitives/math/ge) — True when `a` is greater than or equal to `b`.
- [`lt`](/docs/primitives/math/lt) — True when `a` is less than `b`.
- [`le`](/docs/primitives/math/le) — True when `a` is less than or equal to `b`.
- [`select`](/docs/primitives/math/select) — `ifTrue` when the condition holds, otherwise `ifFalse`.

## Used by

[Crystal](/docs/components/crystal), [Frost](/docs/components/frost), [Irradiance](/docs/components/irradiance), [ReactionDiffusion](/docs/components/reactiondiffusion)