Skip to content

Abs

The absolute value or magnitude of x: , its distance from 0.

Abs(x)the absolute value of a real x, or the modulus of a complex number.
SageMathabs(x)SymPyAbs(x)mpmathfabs(x)

Domain: Arithmetic

Details
  • For a real number, if and if .
  • For a complex number , , its distance from the origin.
  • Always non-negative, with exactly at .
  • Satisfies the triangle inequality .
  • compute-engine doesn't factor constants out of a symbolic argument -- stays as written rather than simplifying to .

Examples

See also: Sign, Chop