int main(int argc, char *argv[]) { std::cout << "Hello Mathematics and Generic Programming!" << std::endl; std::cout << "quotient test1: " << (quotient(5.0, 2.0) == 2 ? "pass" : "fail") << '\n'; std::cout << "quotient_remainder test1: " << (quotient_remainder(8.3, 3.0) == std::make_pair(2, 2.3) ? "pass" : "fail") << "\n"; const auto res = quotient_remainder(8.3, 3.0); std::cout << "quotient_remainder test1a: " << (res.first == 2) << '\n'; std::cout << "quotient_remainder test1b: " << (res.second ) std::cout << "f:" << res.first << " s:" << res.second << "\n"; return 0; }
int main() { std::cout << "gcm0(121, 66) = " << gcm0(121, 66) << std::endl; std::cout << "gcm1(121, 66) = " << gcm1(121, 66) << std::endl; std::cout << "gcm(121, 66) = " << gcm(121, 66) << std::endl; std::cout << "fast_segment_gcm(121, 66) = " << fast_segment_gcm(121, 66) << std::endl; std::cout << "remainder(100, 7) = " << remainder(100, 7) << std::endl; std::cout << "quotient(100, 7) = " << quotient(100, 7) << std::endl; auto p = quotient_remainder(100, 7); std::cout << "quotient_remainder(100, 7) = pair<" << p.first << ", " << p.second << ">" << std::endl; std::cout << "remainder_fibonacci(100, 7) = " << remainder_fibonacci(100, 7) << std::endl; std::cout << "gcm_remainder(121, 66) = " << gcm_remainder(121, 66) << std::endl; std::cout << "gcd(121, 66) = " << gcd(121, 66) << std::endl; }