# RoundingMode

整数Tweenで端数を処理する方向を選びます。既定のToEvenは中間値を偶数側に丸めます。

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public enum RoundingMode : byte
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## 小数部分を切り捨ててカウンターを更新する

`using MeatMotion;` を追加します。0から5への線形補間の半分は2.5です。ToZeroでカウンターには2が入ります。

```csharp
int counter = 0;
using var world = new MotionWorld();
MMotion.Create(0, 5, 1f).WithRoundingMode(RoundingMode.ToZero)
    .WithScheduler(world).Bind(v => counter = v);
world.Tick(0.5);
```

## ToEven

最も近い整数へ丸め、中間値では偶数を選びます。

```csharp
ToEven
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## AwayFromZero

端数がある値を0から遠い側の整数にします。正数は切り上げ、負数は切り下げです。

```csharp
AwayFromZero
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## ToZero

0の方向へ端数を切り捨てます。

```csharp
ToZero
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## ToPositiveInfinity

正の無限大方向へ切り上げます。

```csharp
ToPositiveInfinity
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)

## ToNegativeInfinity

負の無限大方向へ切り下げます。

```csharp
ToNegativeInfinity
```

[Runtime/Adapters/BuiltIn/IntegerOptions.cs · L5](../../source/Runtime/Adapters/BuiltIn/IntegerOptions.cs.html#L5)
