Редагувати

Поділитися через


MathF.Abs(Single) Method

Definition

Returns the absolute value of a single-precision floating-point number.

public:
 static float Abs(float x);
public static float Abs (float x);
static member Abs : single -> single
Public Shared Function Abs (x As Single) As Single

Parameters

x
Single

The number to take the absolute value of.

Returns

The absolute value of x

Remarks

The absolute value of a Single is its numeric value without its sign. For example, the absolute value of both 1.2e-03 and -1.2e03 is 1.2e03.

If x is equal to NegativeInfinity or PositiveInfinity, the return value is PositiveInfinity. If x is equal to NaN, the return value is NaN.

Applies to