请问一下为什么我的双精度数无法比较大小?

输出结果有四个不说,还一个都不对

#include<iostream> 
#include<math.h>
using namespace std;
int max(int a,int b) {
    if (a>=b)
    return a;
else if (a<b)
    return b; 
}
int max(int a,int b,int c){
    int d;{
    if(a>=b)
    d=a;
    else if(a<b)
    d=b;}
    if(d>=c)
    return d;
    else if(d<c) 
    return c;
    } 
    double max(double a,double b){ 
    if (fabs(a-b)>=0.00001)
    return a;
    else if (fabs(a-b)<0.00001)
    return b; 
    } 
double max(double a,double b,double c){
    double d;{
    if(fabs(a-b)>=0.00001)
    d=a;
    else if(fabs(a-b)<0.00001)
    d=b;}
    if(fabs(d-c)>=0.00001)
    return d;
    else if(fabs(d-c)<0.00001) 
    return c;
}
int main(){
    int m,n;
    cin>>m>>n;
    cout<<"the max is "<<max(m,n)<<endl;
    int e,r,t; 
    cin>>e>>r>>t;
    cout<<"the max is "<<max(e,r,t)<<endl;
    double y,u;
    cin>>y>>u;
    cout<<"the max is "<<max(y,u)<<endl;
    double i,o,p;
    cin>>i>>o>>p;
    cout<<"the max is "<<max(i,o,p)<<endl;
    return 0;
}

abs(a-b)>=0.00001
这个是判断ab是否(近似)相等,相等<=0.00001,不相等>=0.00001
fabs是绝对值的意思。
这个不能判断大小,正确的程序我给你了。

你按照我的回答,这么写,并没有任何问题

#include<iostream> 
#include<math.h>
using namespace std;
int max(int a,int b) {
    if (a>=b)
        return a;
    else if (a<b)
        return b; 
}
int max(int a,int b,int c){
    int d;{
        if(a>=b)
            d=a;
        else if(a<b)
            d=b;}
    if(d>=c)
        return d;
    else if(d<c) 
        return c;
} 
double max(double a,double b){ 
    if (a>b)
        return a;
    else if (a<=b)
        return b; 
} 
double max(double a,double b,double c){
    double d;{
        if(a>b)
            d=a;
        else if(a<=b)
            d=b;}
    if(d>c)
        return d;
    else if(d<=c) 
        return c;
}
int main(){
    int m,n;
    cin>>m>>n;
    cout<<"the max is "<<max(m,n)<<endl;
    int e,r,t; 
    cin>>e>>r>>t;
    cout<<"the max is "<<max(e,r,t)<<endl;
    double y,u;
    cin>>y>>u;
    cout<<"the max is "<<max(y,u)<<endl;
    double i,o,p;
    cin>>i>>o>>p;
    cout<<"the max is "<<max(i,o,p)<<endl;
    return 0;
}

1
2
the max is 2
3
6
2
the max is 6
1.8
1.4
the max is 1.8
2.7
2.9
1.6
the max is 2.9
Press any key to continue . . .