minmax.h

Sun, 20 Jun 2004 13:46:00 +0200

author
tuomov
date
Sun, 20 Jun 2004 13:46:00 +0200
changeset 76
58280b944cda
parent 62
aae5facf9fc5
permissions
-rw-r--r--

trunk: changeset 1585
Oops.

60
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
1 /*
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
2 * libtu/minmax.h
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
3 *
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
4 * Copyright (c) Tuomo Valkonen 1999-2004.
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
5 *
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
6 * You may distribute and modify this library under the terms of either
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
8 */
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
9
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
10 #ifndef LIBTU_MINMAX_H
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
11 #define LIBTU_MINMAX_H
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
12
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
13
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
14 static int minof(int x, int y)
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
15 {
62
aae5facf9fc5 trunk: changeset 1318
tuomov
parents: 60
diff changeset
16 return (x<y ? x : y);
60
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
17 }
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
18
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
19
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
20 static int maxof(int x, int y)
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
21 {
62
aae5facf9fc5 trunk: changeset 1318
tuomov
parents: 60
diff changeset
22 return (x>y ? x : y);
60
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
23 }
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
24
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
25
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
26 #endif /* LIBTU_MINMAX_H */
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
27

mercurial