Full name
abs
Library
Built-in
Syntax
abs(n)
Description
The abs function returns the absolute value of a number. The argument can be an integer or a real number. If it is a complex number, its modulus is returned.
Parameters
- n: number whose absolute value (if it is an integer or real number) or module (if it is a complex number) we want to extract
Examples
The following examples calculate the absolute value of integers and real numbers:
If the argument is a complex number, its modulus is returned: