Unity - Scripting API: Mathf.Max
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.
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.
Declaration
public static float Max(float a, float b);
Declaration
public static float Max(params float[] values);
Parameters
| Parameter | Description |
|---|---|
| a | First value to compare. |
| b | Second value to compare. |
| values | Array of values to compare. |
Returns
float Greatest value found between all compared values.
Description
Returns the maximum of two or more values.
The resulting value will be the input value closest to 'Mathf.Infinity'.
Additional resources: Min.
Declaration
public static int Max(int a, int b);
Declaration
public static int Max(params int[] values);
Parameters
| Parameter | Description |
|---|---|
| a | First value to compare. |
| b | Second value to compare. |
| values | Array of values to compare. |
Returns
void Greatest value found between all compared values.
Description
Returns the maximum of two or more values.
The resulting value will be the input value closest to 'int.MaxValue'.
Additional resources: Min.