[STL]find the big number betweand 4 num

Problem:
I've 4 abs numbers (double) and i want to know what is the big. In STL there is already a function?

I've implemented it in te simple way (tis is a pseudocode):

1
2
3
4
5
6
7
8
9
10
11
double A,B,C,D;

a=fabs(A);
b=fabs(B);
c=fabs(C);
d=fabs(D);

if (a>=b && a>=c && a>=d) then a is the big;
else if (b>=a && b>=c && b>=d) then b is the big;
else if (c>=a && c>=b && c>=d) then c is the big;
else then d is the big;


I want find/implement the fastest solution..
Someone have an advise?

Thanks
There is a function to do that somewhere on this page
http://www.cplusplus.com/reference/algorithm/
Topic archived. No new replies allowed.