modf
Splits a float value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input.
Read time 3 minutesLast updated 5 days ago
Definition
- Type: Method
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
modf(float, float)
Splits a float value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input.
public static float modf(float x, out float i)
Parameters
Returns
Type | Description |
|---|---|
| float | The fractional part of x. |
modf(float2, float2)
Performs a componentwise split of a float2 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.
public static float2 modf(float2 x, out float2 i)
Parameters
Returns
Type | Description |
|---|---|
| float2 | The componentwise fractional part of x. |
modf(float3, float3)
Performs a componentwise split of a float3 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.
public static float3 modf(float3 x, out float3 i)
Parameters
Returns
Type | Description |
|---|---|
| float3 | The componentwise fractional part of x. |
modf(float4, float4)
Performs a componentwise split of a float4 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.
public static float4 modf(float4 x, out float4 i)
Parameters
Returns
Type | Description |
|---|---|
| float4 | The componentwise fractional part of x. |
modf(double, double)
Splits a double value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input.
public static double modf(double x, out double i)
Parameters
Returns
Type | Description |
|---|---|
| double | The fractional part of x. |
modf(double2, double2)
Performs a componentwise split of a double2 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.
public static double2 modf(double2 x, out double2 i)
Parameters
Returns
Type | Description |
|---|---|
| double2 | The componentwise fractional part of x. |
modf(double3, double3)
Performs a componentwise split of a double3 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.
public static double3 modf(double3 x, out double3 i)
Parameters
Returns
Type | Description |
|---|---|
| double3 | The componentwise fractional part of x. |
modf(double4, double4)
Performs a componentwise split of a double4 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.
public static double4 modf(double4 x, out double4 i)
Parameters
Returns
Type | Description |
|---|---|
| double4 | The componentwise fractional part of x. |