PrevUpHomeNext

.abs method


.abs member function of utx::class_type

utx::class_type::abs

Method .abs of utx::class_type can be used to get the absolute value of integral or floating value of utx::class_type.

c++ example

#include <utxcpp/core.hpp>

int main()
{
	constexpr utx::ix32 a = 254;
	constexpr utx::fx64 b = 542.445;
	constexpr utx::ix32 c = -254;
	constexpr utx::fx64 d = -542.445;
	utx::print(a.abs(), b.abs(), c.abs(), d.abs());	// 254 542.445 254 542.445
}

See Also

utx::ix32

utx::fx64


PrevUpHomeNext

utx::print

esv::print