PrevUpHomeNext

utx::abs


utx::abs

utx::abs calculates an absolute value of a mathematical real value. That is, if the value < 0, return -value, else return value.

Calling Sig

Return type is the same as the type of value.

constexpr auto abs_value = utx::abs(value);

Return type is the same as the type of value.

constexpr auto abs_value = utx::abs.fn(value);

Return type is always return_type .

For example,

constexpr auto abs_value = utx::abs.fn<return_type>(value);

Return type is return_type, arg type is arg_type.

For example,

constexpr auto abs_value = utx::abs.fn<return_type, arg_type>(value);

Special args and returns

arg value => return value:

cpp example

#include <utxcpp/core.hpp>
#include <utxcpp/math.hpp>

int main()
{
	for (utx::ix32 i=-4; i<=4; ++i)
		utx::print(utx::abs(i));
}

See Also

utx::cos

utx::sin

utx::ix32

utx::print


PrevUpHomeNext

utx::print

esv::print