# fmod

> Returns the floating point remainder of x/y.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Mathematics](/engine/6000.7/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

## fmod(float, float)

Returns the floating point remainder of x/y.

```csharp
public static float fmod(float x, float y)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The dividend in x/y.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The divisor in x/y.

### Returns

| Type                                                          | Description           |
| ------------------------------------------------------------- | --------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The remainder of x/y. |

## fmod(float2, float2)

Returns the componentwise floating point remainder of x/y.

```csharp
public static float2 fmod(float2 x, float2 y)
```

### Parameters

**** (\[float2]\(/engine/6000.7/script-reference/unity/mathematics/float2)): The dividend in x/y.**** (\[float2]\(/engine/6000.7/script-reference/unity/mathematics/float2)): The divisor in x/y.

### Returns

| Type                                                                  | Description                         |
| --------------------------------------------------------------------- | ----------------------------------- |
| [float2](/engine/6000.7/script-reference/unity/mathematics/float2.md) | The componentwise remainder of x/y. |

## fmod(float3, float3)

Returns the componentwise floating point remainder of x/y.

```csharp
public static float3 fmod(float3 x, float3 y)
```

### Parameters

**** (\[float3]\(/engine/6000.7/script-reference/unity/mathematics/float3)): The dividend in x/y.**** (\[float3]\(/engine/6000.7/script-reference/unity/mathematics/float3)): The divisor in x/y.

### Returns

| Type                                                                  | Description                         |
| --------------------------------------------------------------------- | ----------------------------------- |
| [float3](/engine/6000.7/script-reference/unity/mathematics/float3.md) | The componentwise remainder of x/y. |

## fmod(float4, float4)

Returns the componentwise floating point remainder of x/y.

```csharp
public static float4 fmod(float4 x, float4 y)
```

### Parameters

**** (\[float4]\(/engine/6000.7/script-reference/unity/mathematics/float4)): The dividend in x/y.**** (\[float4]\(/engine/6000.7/script-reference/unity/mathematics/float4)): The divisor in x/y.

### Returns

| Type                                                                  | Description                         |
| --------------------------------------------------------------------- | ----------------------------------- |
| [float4](/engine/6000.7/script-reference/unity/mathematics/float4.md) | The componentwise remainder of x/y. |

## fmod(double, double)

Returns the double precision floating point remainder of x/y.

```csharp
public static double fmod(double x, double y)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): The dividend in x/y.**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): The divisor in x/y.

### Returns

| Type                                                           | Description           |
| -------------------------------------------------------------- | --------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | The remainder of x/y. |

## fmod(double2, double2)

Returns the componentwise double precision floating point remainder of x/y.

```csharp
public static double2 fmod(double2 x, double2 y)
```

### Parameters

**** (\[double2]\(/engine/6000.7/script-reference/unity/mathematics/double2)): The dividend in x/y.**** (\[double2]\(/engine/6000.7/script-reference/unity/mathematics/double2)): The divisor in x/y.

### Returns

| Type                                                                    | Description                         |
| ----------------------------------------------------------------------- | ----------------------------------- |
| [double2](/engine/6000.7/script-reference/unity/mathematics/double2.md) | The componentwise remainder of x/y. |

## fmod(double3, double3)

Returns the componentwise double precision floating point remainder of x/y.

```csharp
public static double3 fmod(double3 x, double3 y)
```

### Parameters

**** (\[double3]\(/engine/6000.7/script-reference/unity/mathematics/double3)): The dividend in x/y.**** (\[double3]\(/engine/6000.7/script-reference/unity/mathematics/double3)): The divisor in x/y.

### Returns

| Type                                                                    | Description                         |
| ----------------------------------------------------------------------- | ----------------------------------- |
| [double3](/engine/6000.7/script-reference/unity/mathematics/double3.md) | The componentwise remainder of x/y. |

## fmod(double4, double4)

Returns the componentwise double precision floating point remainder of x/y.

```csharp
public static double4 fmod(double4 x, double4 y)
```

### Parameters

**** (\[double4]\(/engine/6000.7/script-reference/unity/mathematics/double4)): The dividend in x/y.**** (\[double4]\(/engine/6000.7/script-reference/unity/mathematics/double4)): The divisor in x/y.

### Returns

| Type                                                                    | Description                         |
| ----------------------------------------------------------------------- | ----------------------------------- |
| [double4](/engine/6000.7/script-reference/unity/mathematics/double4.md) | The componentwise remainder of x/y. |
