PrevUpHomeNext

esv::fact


The love of birds begins with the heart.

esv::fact

esv::fact calculates the factorial result of value.

Calling Sig:

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

esv::fact(???) :

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

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

Header

#include <esvcpp/math.hpp>

Example

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

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

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

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

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

See Also

esv::print

esv::u32

esv::ux32

esv::f32

esv::fx32

esv::i32

esv::ix32


PrevUpHomeNext

esv::print