Method modf
modf(float, out 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.
Declaration
public static float modf(float x, out float i)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | Value to split into integral and fractional part. |
| float | i | Output value containing integral part of x. |
Returns
| Type | Description |
|---|---|
| float | The fractional part of x. |
modf(float2, out 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.
Declaration
public static float2 modf(float2 x, out float2 i)
Parameters
| Type | Name | Description |
|---|---|---|
| float2 | x | Value to split into integral and fractional part. |
| float2 | i | Output value containing integral part of x. |
Returns
| Type | Description |
|---|---|
| float2 | The componentwise fractional part of x. |
modf(float3, out 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.
Declaration
public static float3 modf(float3 x, out float3 i)
Parameters
| Type | Name | Description |
|---|---|---|
| float3 | x | Value to split into integral and fractional part. |
| float3 | i | Output value containing integral part of x. |
Returns
| Type | Description |
|---|---|
| float3 | The componentwise fractional part of x. |
modf(float4, out 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.
Declaration
public static float4 modf(float4 x, out float4 i)
Parameters
| Type | Name | Description |
|---|---|---|
| float4 | x | Value to split into integral and fractional part. |
| float4 | i | Output value containing integral part of x. |
Returns
| Type | Description |
|---|---|
| float4 | The componentwise fractional part of x. |
modf(double, out 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.
Declaration
public static double modf(double x, out double i)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | Value to split into integral and fractional part. |
| double | i | Output value containing integral part of x. |
Returns
| Type | Description |
|---|---|
| double | The fractional part of x. |
modf(double2, out 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.
Declaration
public static double2 modf(double2 x, out double2 i)
Parameters
| Type | Name | Description |
|---|---|---|
| double2 | x | Value to split into integral and fractional part. |
| double2 | i | Output value containing integral part of x. |
Returns
| Type | Description |
|---|---|
| double2 | The componentwise fractional part of x. |
modf(double3, out 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.
Declaration
public static double3 modf(double3 x, out double3 i)
Parameters
| Type | Name | Description |
|---|---|---|
| double3 | x | Value to split into integral and fractional part. |
| double3 | i | Output value containing integral part of x. |
Returns
| Type | Description |
|---|---|
| double3 | The componentwise fractional part of x. |
modf(double4, out 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.
Declaration
public static double4 modf(double4 x, out double4 i)
Parameters
| Type | Name | Description |
|---|---|---|
| double4 | x | Value to split into integral and fractional part. |
| double4 | i | Output value containing integral part of x. |
Returns
| Type | Description |
|---|---|
| double4 | The componentwise fractional part of x. |