Function reference · Math

abs

Computes the absolute value of an expression.

Nerdamer simplifies absolute values when sign information is available from numbers, algebraic structure, or assumptions. Even powers are recognized as non-negative, while genuinely sign-unknown expressions remain wrapped in abs.

For complex inputs, absolute value is the complex modulus.

Examples

These examples use Nerdamer Notation.

Take the absolute value of a negative number.

abs(-5)
// → 5

Recognize an even power as non-negative.

abs(x^2)
// → x^2

Preserve an unknown sign symbolically.

abs(x)

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API

Nerdamer Notation

Use this form inside input passed to nerdamer(...).

abs(arg1)

nerdamer.abs

Call the operation through the default nerdamer import.

nerdamer.abs(x: ExpressionInput): Expression

Parameters

NameTypeDescription
xExpressionInputThe expression to take the absolute value of.

Returns

Expression — The absolute value of `x`.

Browse the nerdamer API →

← Back to Reference