Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working
Show menu Show menu

ABS function

Description

Absolute value. ABS(x) returns the absolute value of the number x.

ABS function$$ |x| = \begin{cases} x, & \mbox{if } x \ge 0 \\ -x, & \mbox{if } x < 0 \end{cases} $$

The argument x can be a real number, a complex number, or a matrix. When it is a complex number, the function returns the norm or modulus |x| (see Norm function). When the argument is a matrix, the function returns a matrix with the same dimensions and with the ABS function applied to all elements.

Examples

ABS(-5) returns 5

ABS(5) returns 5

ABS({-3,2+1i}) returns {3,2.2360679775}

Calculator

ABS(  

Graph

ABS function

Related functions