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

math.step

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 step(float threshold, float x);

Parameters

Parameter Description
threshold Value to be used as a threshold for returning 1.
x Value to compare against threshold.

Returns

float 1 if the comparison x >= threshold is true, otherwise 0.

Description

Returns the result of a step function where the result is 1.0f when x >= threshold and 0.0f otherwise.


Declaration

public static float2 step(float2 threshold, float2 x);

Parameters

Parameter Description
threshold Vector of values to be used as a threshold for returning 1.
x Vector of values to compare against threshold.

Returns

float2 1 if the componentwise comparison x >= threshold is true, otherwise 0.

Description

Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.


Declaration

public static float3 step(float3 threshold, float3 x);

Parameters

Parameter Description
threshold Vector of values to be used as a threshold for returning 1.
x Vector of values to compare against threshold.

Returns

float3 1 if the componentwise comparison x >= threshold is true, otherwise 0.

Description

Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.


Declaration

public static float4 step(float4 threshold, float4 x);

Parameters

Parameter Description
threshold Vector of values to be used as a threshold for returning 1.
x Vector of values to compare against threshold.

Returns

float4 1 if the componentwise comparison x >= threshold is true, otherwise 0.

Description

Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.


Declaration

public static double step(double threshold, double x);

Parameters

Parameter Description
threshold Values to be used as a threshold for returning 1.
x Value to compare against threshold.

Returns

double 1 if the comparison x >= threshold is true, otherwise 0.

Description

Returns the result of a step function where the result is 1.0f when x >= threshold and 0.0f otherwise.


Declaration

public static double2 step(double2 threshold, double2 x);

Parameters

Parameter Description
threshold Vector of values to be used as a threshold for returning 1.
x Vector of values to compare against threshold.

Returns

double2 1 if the componentwise comparison x >= threshold is true, otherwise 0.

Description

Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.


Declaration

public static double3 step(double3 threshold, double3 x);

Parameters

Parameter Description
threshold Vector of values to be used as a threshold for returning 1.
x Vector of values to compare against threshold.

Returns

double3 1 if the componentwise comparison x >= threshold is true, otherwise 0.

Description

Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.


Declaration

public static double4 step(double4 threshold, double4 x);

Parameters

Parameter Description
threshold Vector of values to be used as a threshold for returning 1.
x Vector of values to compare against threshold.

Returns

double4 1 if the componentwise comparison x >= threshold is true, otherwise 0.

Description

Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.