Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

math.modf

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static float modf(float x, out float i);

Parameters

Parameter Description
x Value to split into integral and fractional part.
i Output value containing integral part of x.

Returns

float The fractional part of x.

Description

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 float2 modf(float2 x, out float2 i);

Parameters

Parameter Description
x Value to split into integral and fractional part.
i Output value containing integral part of x.

Returns

float2 The componentwise fractional part of x.

Description

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 float3 modf(float3 x, out float3 i);

Parameters

Parameter Description
x Value to split into integral and fractional part.
i Output value containing integral part of x.

Returns

float3 The componentwise fractional part of x.

Description

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 float4 modf(float4 x, out float4 i);

Parameters

Parameter Description
x Value to split into integral and fractional part.
i Output value containing integral part of x.

Returns

float4 The componentwise fractional part of x.

Description

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 double modf(double x, out double i);

Parameters

Parameter Description
x Value to split into integral and fractional part.
i Output value containing integral part of x.

Returns

double The fractional part of x.

Description

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 double2 modf(double2 x, out double2 i);

Parameters

Parameter Description
x Value to split into integral and fractional part.
i Output value containing integral part of x.

Returns

double2 The componentwise fractional part of x.

Description

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 double3 modf(double3 x, out double3 i);

Parameters

Parameter Description
x Value to split into integral and fractional part.
i Output value containing integral part of x.

Returns

double3 The componentwise fractional part of x.

Description

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 double4 modf(double4 x, out double4 i);

Parameters

Parameter Description
x Value to split into integral and fractional part.
i Output value containing integral part of x.

Returns

double4 The componentwise fractional part of x.

Description

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.