System.Math.Abs Method

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

Syntax

public static double Abs (double value)

Parameters

value
A number that is greater than or equal to double.MinValue, but less than or equal to double.MaxValue.

Returns

A double-precision floating-point number, x, such that 0 ≤ x ≤ double.MaxValue.

Remarks

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

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

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0