std::experimental::gcd(3)
π NAME π
std::experimental::gcd(3) β okay bestie, this is from the C++ Standard Libary manual, and the NAME entry is literally std::experimental::gcd β std::experimental::gcd. Yes, she's named after herself. Main character energy only. π
β¨ Synopsis β¨
Here's the synopsis, no cap:
Defined in header <experimental/numeric>
template< class M, class N> (library
fundamentals TS v2)
constexpr std::common_type_t<M, N> gcd( M m, N n );
It computes the greatest common divisor of the integers m and n. Math, but make it cute. β¨
π«Ά Parameters π«Ά
m,nβ integer values. That's it. Periodt. π«Ά
π Return value π
If both m and n are zero, it returns zero. Otherwise, it returns the greatest common divisor of |m| and |n|. π
πΈ Remarks πΈ
Okay, listen: if either M or N is not an integer type, or if either is (possibly cv-qualified) bool, the program is ill-formed. Not a vibe, but that's the rule. π
Also, if either |m| or |n| is not representable as a value of type std::common_type_t<M, N>, the behavior is undefined. That's the scary one, bestie β undefined behavior is not it. π
π Exceptions π
Throws no exceptions. Zero. Nada. She's calm, she's iconic, she's not throwing hands. π«Ά
π See also π
lcmβ constexpr function template returning the least common multiple of two integers (function template). Obsessed with the symmetry. π
Okay that's the whole page! Source: cppreference.com, version/date: 2024.06.10, page: std::experimental::gcd(3). Bye bestie, go find some common ground π
πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms