Formualizer Docs

IMABS

Returns the modulus (absolute value) of a complex number.

Computes sqrt(real^2 + imaginary^2).

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=IMABS(inumber)

Arguments

ArgumentTypeRequiredDefault
inumberanyRequired—

How it works

For z = a + bi, the magnitude is √(a² + b²). It is defined for every complex number, including zero.

Remarks

  • Inputs are coerced to complex-number text before parsing.
  • Returns a non-negative real number.

Error cases

  • Invalid complex text returns #NUM!.

Examples

Find the distance from 3 + 4i to zero.

Formula =IMABS("3+4i")

Expected result 5

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Changing the sign of the imaginary component preserves the magnitude.

Formula =IMABS("3-4j")

Expected result 5

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A real unit has magnitude one.

Formula =IMABS("1")

Expected result 1

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The text “invalid” has no complex value from which to take the modulus.

Formula =IMABS("invalid")

Expected result #NUM!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Purely real input

Formula =IMABS("5")

Expected result 5

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

Can IMABS return a negative result?

No. It computes the modulus sqrt(a^2+b^2), which is always non-negative.

Implementation

Engine source

On this page