On the library to which the __gcd(,) function belongs

Konjac accidentally found out that the gcd that I have a headache has a ready-made function - " __gcd(x,y) "

First, the dry goods,

__gcd(x,y) is a function in the algorithm library

, Well, the only answer on Baidu about which library it belongs to is from me.

However, this function does not seem to be so simple. It seems that the compiler comes with #@! *¥~…

Next, let's cite Baidu.

weird

Really bald, let's see an example below.

#include<cstdio>
#include<algorithm>
using namespace std;
int n,m;
int main()
{
    scanf("%d %d",&n,&m);
    int k=__gcd(n,m);//最大公约数
    printf("%d",k);
    return 0;
}
ps In order to prove that it is not a function of the iostream library, I specifically removed the iostream call.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325691241&siteId=291194637