# AddSat(long, long)

> Atomically adds a value to this counter. The result will not be greater than a maximum value.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections.LowLevel.Unsafe](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public long AddSat(long value, long max = 9223372036854775807)
```

### Parameters

**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): The value to add to this counter.**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): The maximum which the result will not be greater than.

### Returns

| Type                                                        | Description                        |
| ----------------------------------------------------------- | ---------------------------------- |
| [long](https://learn.microsoft.com/dotnet/api/system.int64) | The original value before the add. |
