PrevUpHomeNext

.quo_mod method


Man makes friend with fire.

.quo_mod member function of esv::class_type

esv::class_type::quo_mod

Method .quo_mod of esv::class_type is used to get the quotient and modulus result of a value divided by another value. As the calculating of modulus will also calculate the quotient value, if you need both of them, you can use .quo_mod method, not .mod, which will save duplicated calculating.

It returns esv::pair type to hold two values.

Positive/Negative flag rules, a % b :

c++ example

#include <esvcpp/core.hpp>

int main()
{
	esv::ix32 a = -32;
	esv::pair<esv::ix32, esv::ix32> b = a.quo_mod(-7);
	esv::print(a.first, a.second);	// 4 -4
}

See Also

.mod method

.quo method

esv::ix32

esv::pair

esv::print


PrevUpHomeNext

E