minmax.h

Mon, 20 Apr 2020 10:14:32 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 20 Apr 2020 10:14:32 -0500
changeset 119
87e3bb5086e8
parent 62
aae5facf9fc5
permissions
-rw-r--r--

Convert README to markdown

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