PrevUpHomeNext

utx::fact


utx::fact

utx::fact calculates the factorial result of value.

Calling Sig:

constexpr auto result = utx::fact(unsigned_value);
constexpr auto result = utx::fact.fn<return_type>(unsigned_value);
constexpr auto result = utx::fact.fn<return_type, unsignned_arg_type>(value);

utx::fact(???) :

utx::fact.fn<return_type>(???) :

utx::fact.fn<return_type, unsigned_arg_type>(???) :

Header

#include <utxcpp/math.hpp>

Example

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

int main()
{
	// arg_type is utx::u32
	constexpr auto result1 = utx::fact(8u);

	// arg_type is utx::u32, result is converted to utx::f32
	constexpr auto result1 = utx::fact<utx::f32>(8u);

	// arg_type is utx::ux32, result is converted to utx::ix32
	constexpr auto result2 = utx::fact<utx::ix32, utx::ux32>(8);

	utx::print(result1, result2, result3);
}

See Also

utx::print

utx::u32

utx::ux32

utx::f32

utx::fx32

utx::i32

utx::ix32


PrevUpHomeNext

utx::print

esv::print