fmodsafe
Returns the floating point remainder of x/y, or zero if y is zero.
Read time 3 minutesLast updated 5 days ago
Definition
- Type: Method
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
fmodsafe(float, float)
Returns the floating point remainder of x/y, or zero if y is zero.
public static float fmodsafe(float x, float y)
Parameters
Returns
Type | Description |
|---|---|
| float | The remainder of x/y, or zero. |
Remarks
Unlike math.fmod, a zero or NaN divisor returns zero instead of NaN.
fmodsafe(float2, float2)
Returns the componentwise floating point remainder of x/y, or zero for each component where y is zero.
public static float2 fmodsafe(float2 x, float2 y)
Parameters
Returns
Type | Description |
|---|---|
| float2 | The componentwise remainder of x/y, or zero. |
Remarks
Unlike math.fmod, a zero or NaN divisor component returns zero instead of NaN.
fmodsafe(float3, float3)
Returns the componentwise floating point remainder of x/y, or zero for each component where y is zero.
public static float3 fmodsafe(float3 x, float3 y)
Parameters
Returns
Type | Description |
|---|---|
| float3 | The componentwise remainder of x/y, or zero. |
Remarks
Unlike math.fmod, a zero or NaN divisor component returns zero instead of NaN.
fmodsafe(float4, float4)
Returns the componentwise floating point remainder of x/y, or zero for each component where y is zero.
public static float4 fmodsafe(float4 x, float4 y)
Parameters
Returns
Type | Description |
|---|---|
| float4 | The componentwise remainder of x/y, or zero. |
Remarks
Unlike math.fmod, a zero or NaN divisor component returns zero instead of NaN.
fmodsafe(double, double)
Returns the double precision floating point remainder of x/y, or zero if y is zero.
public static double fmodsafe(double x, double y)
Parameters
Returns
Type | Description |
|---|---|
| double | The remainder of x/y, or zero. |
Remarks
Unlike math.fmod, a zero or NaN divisor returns zero instead of NaN.
fmodsafe(double2, double2)
Returns the componentwise double precision floating point remainder of x/y, or zero for each component where y is zero.
public static double2 fmodsafe(double2 x, double2 y)
Parameters
Returns
Type | Description |
|---|---|
| double2 | The componentwise remainder of x/y, or zero. |
Remarks
Unlike math.fmod, a zero or NaN divisor component returns zero instead of NaN.
fmodsafe(double3, double3)
Returns the componentwise double precision floating point remainder of x/y, or zero for each component where y is zero.
public static double3 fmodsafe(double3 x, double3 y)
Parameters
Returns
Type | Description |
|---|---|
| double3 | The componentwise remainder of x/y, or zero. |
Remarks
Unlike math.fmod, a zero or NaN divisor component returns zero instead of NaN.
fmodsafe(double4, double4)
Returns the componentwise double precision floating point remainder of x/y, or zero for each component where y is zero.
public static double4 fmodsafe(double4 x, double4 y)
Parameters
Returns
Type | Description |
|---|---|
| double4 | The componentwise remainder of x/y, or zero. |
Remarks
Unlike math.fmod, a zero or NaN divisor component returns zero instead of NaN.