[linalg.helpers.abs]

# 29 Numerics library [[numerics]](./#numerics)

## 29.9 Basic linear algebra algorithms [[linalg]](linalg#helpers.abs)

### 29.9.7 Exposition-only helpers [[linalg.helpers]](linalg.helpers#abs)

#### 29.9.7.1 *abs-if-needed* [linalg.helpers.abs]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12294)

The name *abs-if-needed* denotes an exposition-only function object[.](#1.sentence-1)

The expression *abs-if-needed*(E) for a subexpression E whose type is T is expression-equivalent to:

- [(1.1)](#1.1)

E if T is an unsigned integer;

- [(1.2)](#1.2)

otherwise, std​::​abs(E) if T is an arithmetic type,

- [(1.3)](#1.3)

otherwise, abs(E),
if that expression is valid,
with overload resolution performed in a context that includes the declarationtemplate<class U> U abs(U) = delete;
   If the function selected by overload resolution
does not return the absolute value of its input,
the program is ill-formed, no diagnostic required[.](#1.3.sentence-2)
