Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


abs

Returns the absolute value of a int value.
Read time 2 minutesLast updated 5 days ago

Definition

abs(int)

Returns the absolute value of a int value.
public static int abs(int x)

Parameters

Input value.

Returns

Type

Description

intThe 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

int2The 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

int3The 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

int4The 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

longThe 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

floatThe 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

float2The 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

float3The 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

float4The 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

doubleThe 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

double2The 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

double3The 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

double4The componentwise absolute value of the input.