Name

abs function template — Computes absolute value

Synopsis

template<typename T> T abs(const complex<T>& z)

The abs function returns the absolute value (or magnitude) of z.

See Also

polar function template, abs function in <cmath>

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.