abs
Returns the absolute value of a int value.
Read time 2 minutesLast updated 5 days ago
Definition
- Type: Method
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
abs(int)
Returns the absolute value of a int value.
public static int abs(int x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| int | The absolute value of the input. |
abs(int2)
Returns the componentwise absolute value of a int2 vector.
public static int2 abs(int2 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| int2 | The componentwise absolute value of the input. |
abs(int3)
Returns the componentwise absolute value of a int3 vector.
public static int3 abs(int3 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| int3 | The componentwise absolute value of the input. |
abs(int4)
Returns the componentwise absolute value of a int4 vector.
public static int4 abs(int4 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| int4 | The componentwise absolute value of the input. |
abs(long)
Returns the absolute value of a long value.
public static long abs(long x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| long | The absolute value of the input. |
abs(float)
Returns the absolute value of a float value.
public static float abs(float x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| float | The absolute value of the input. |
abs(float2)
Returns the componentwise absolute value of a float2 vector.
public static float2 abs(float2 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| float2 | The componentwise absolute value of the input. |
abs(float3)
Returns the componentwise absolute value of a float3 vector.
public static float3 abs(float3 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| float3 | The componentwise absolute value of the input. |
abs(float4)
Returns the componentwise absolute value of a float4 vector.
public static float4 abs(float4 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| float4 | The componentwise absolute value of the input. |
abs(double)
Returns the absolute value of a double value.
public static double abs(double x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| double | The absolute value of the input. |
abs(double2)
Returns the componentwise absolute value of a double2 vector.
public static double2 abs(double2 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| double2 | The componentwise absolute value of the input. |
abs(double3)
Returns the componentwise absolute value of a double3 vector.
public static double3 abs(double3 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| double3 | The componentwise absolute value of the input. |
abs(double4)
Returns the componentwise absolute value of a double4 vector.
public static double4 abs(double4 x)
Parameters
Input value.
Returns
Type | Description |
|---|---|
| double4 | The componentwise absolute value of the input. |