abs(X)

Prototype

template <class X>
typename abs_functor<X>::result_type abs(X const&) ;

Description

Computes the absolute value (magnitude or modulus) of an object of type X.

The reason glas has its own abs function is because of the extensibility through the use of the abs_functor<X>()(x) for which abs(X) is just a shortcut.

Definition

Defined in abs.hpp

Requirements on types

Example

See abs test programs