PrevUpHomeNext

esv::abs


Listen to a clear birdsong.

esv::abs

esv::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 = esv::abs(value);

Return type is the same as the type of value.

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

Return type is always return_type .

For example,

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

Return type is return_type, arg type is arg_type.

For example,

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

Special args and returns

arg value => return value:

cpp example

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

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

See Also

esv::cos

esv::sin

esv::ix32

esv::print


PrevUpHomeNext

esv::print