# shz_vec2_saturate

Source: https://sh4zam.com/api/vector/shz_vec2_saturate/

> Returns a 2D vector whose components are saturated (clamped to [0, 1]) values of the given vector's components

```c
SHZ_INLINE shz_vec2_t shz_vec2_saturate(shz_vec2_t vec) SHZ_NOEXCEPT;
```

Returns a 2D vector whose components are saturated (clamped to \[0, 1\]) values of the given vector's components.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vec` | `shz_vec2_t` |  |

## Returns

`shz_vec2_t`

## Availability

- **C++ equivalent:** [`shz::vec2::saturate`](https://sh4zam.com/api/cpp/vec2/#saturate)
- **Type-generic form:** [`shz_vec_saturate()`](https://sh4zam.com/api/vector/shz_vec_saturate/)
- **Back-ends:** SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_vector.h:237`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_vector.h#L237)
- **Module:** [Vector](https://sh4zam.com/api/vector/), section "Component-wise Operations"
