source: Sophya/trunk/Poubelle/DPC:FitsIOServer/Blitz/blitz/minmax.h

Last change on this file was 658, checked in by ansari, 26 years ago

no message

File size: 529 bytes
Line 
1#ifndef BZ_MINMAX_H
2#define BZ_MINMAX_H
3
4#include <blitz/promote.h>
5
6BZ_NAMESPACE(blitz)
7
8template<class T1, class T2>
9BZ_PROMOTE(T1,T2) min(const T1& a, const T2& b)
10{
11 typedef BZ_PROMOTE(T1,T2) T_promote;
12
13 if (a <= b)
14 return T_promote(a);
15 else
16 return T_promote(b);
17}
18
19template<class T1, class T2>
20BZ_PROMOTE(T1,T2) max(const T1& a, const T2& b)
21{
22 typedef BZ_PROMOTE(T1,T2) T_promote;
23
24 if (a >= b)
25 return T_promote(a);
26 else
27 return T_promote(b);
28}
29
30BZ_NAMESPACE_END
31
32#endif
Note: See TracBrowser for help on using the repository browser.