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

math.max

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 int max(int x, int y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

int The maximum of the two input values.

Description

Returns the maximum of two int values.


Declaration

public static int2 max(int2 x, int2 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

int2 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two int2 vectors.


Declaration

public static int3 max(int3 x, int3 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

int3 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two int3 vectors.


Declaration

public static int4 max(int4 x, int4 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

int4 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two int4 vectors.


Declaration

public static uint max(uint x, uint y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

uint The maximum of the two input values.

Description

Returns the maximum of two uint values.


Declaration

public static uint2 max(uint2 x, uint2 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

uint2 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two uint2 vectors.


Declaration

public static uint3 max(uint3 x, uint3 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

uint3 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two uint3 vectors.


Declaration

public static uint4 max(uint4 x, uint4 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

uint4 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two uint4 vectors.


Declaration

public static long max(long x, long y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

long The maximum of the two input values.

Description

Returns the maximum of two long values.


Declaration

public static ulong max(ulong x, ulong y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

ulong The maximum of the two input values.

Description

Returns the maximum of two ulong values.


Declaration

public static float max(float x, float y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

float The maximum of the two input values.

Description

Returns the maximum of two float values.


Declaration

public static float2 max(float2 x, float2 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

float2 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two float2 vectors.


Declaration

public static float3 max(float3 x, float3 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

float3 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two float3 vectors.


Declaration

public static float4 max(float4 x, float4 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

float4 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two float4 vectors.


Declaration

public static double max(double x, double y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

double The maximum of the two input values.

Description

Returns the maximum of two double values.


Declaration

public static double2 max(double2 x, double2 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

double2 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two double2 vectors.


Declaration

public static double3 max(double3 x, double3 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

double3 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two double3 vectors.


Declaration

public static double4 max(double4 x, double4 y);

Parameters

Parameter Description
x The first input value.
y The second input value.

Returns

double4 The componentwise maximum of the two input values.

Description

Returns the componentwise maximum of two double4 vectors.