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

math.saturate

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 saturate(float x);

Parameters

Parameter Description
x Input value.

Returns

float The clamping of the input into the interval [0, 1].

Description

Returns the result of clamping the float value x into the interval [0, 1].


Declaration

public static float2 saturate(float2 x);

Parameters

Parameter Description
x Input value.

Returns

float2 The componentwise clamping of the input into the interval [0, 1].

Description

Returns the result of a componentwise clamping of the float2 vector x into the interval [0, 1].


Declaration

public static float3 saturate(float3 x);

Parameters

Parameter Description
x Input value.

Returns

float3 The componentwise clamping of the input into the interval [0, 1].

Description

Returns the result of a componentwise clamping of the float3 vector x into the interval [0, 1].


Declaration

public static float4 saturate(float4 x);

Parameters

Parameter Description
x Input value.

Returns

float4 The componentwise clamping of the input into the interval [0, 1].

Description

Returns the result of a componentwise clamping of the float4 vector x into the interval [0, 1].


Declaration

public static double saturate(double x);

Parameters

Parameter Description
x Input value.

Returns

double The clamping of the input into the interval [0, 1].

Description

Returns the result of clamping the double value x into the interval [0, 1].


Declaration

public static double2 saturate(double2 x);

Parameters

Parameter Description
x Input value.

Returns

double2 The componentwise clamping of the input into the interval [0, 1].

Description

Returns the result of a componentwise clamping of the double2 vector x into the interval [0, 1].


Declaration

public static double3 saturate(double3 x);

Parameters

Parameter Description
x Input value.

Returns

double3 The componentwise clamping of the input into the interval [0, 1].

Description

Returns the result of a componentwise clamping of the double3 vector x into the interval [0, 1].


Declaration

public static double4 saturate(double4 x);

Parameters

Parameter Description
x Input value.

Returns

double4 The componentwise clamping of the input into the interval [0, 1].

Description

Returns the result of a componentwise clamping of the double4 vector x into the interval [0, 1].