---
title: "le"
description: "True when `a` is less than or equal to `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#L453"
---

# le

True when `a` is less than or equal to `b`.

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

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

## Parameters

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

## Example

```ts
const inBand = select(le(abs(d), width), 1, 0)
```

## See also

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

## Used by

[Goo](/docs/components/goo)