formats: clarify setting of reverse_bytes
[sox.git] / lpc10 / median.c
blob5f91804dc8004971d4b68c681c489fbfb83df894
1 /*
3 * Revision 1.1 1996/08/19 22:31:31 jaf
4 * Initial revision
7 */
9 /* -- translated by f2c (version 19951025).
10 You must link the resulting object file with the libraries:
11 -lf2c -lm (in that order)
14 #include "f2c.h"
16 extern integer median_(integer *d1, integer *d2, integer *d3);
18 /* ********************************************************************* */
20 /* MEDIAN Version 45G */
23 * Revision 1.1 1996/08/19 22:31:31 jaf
24 * Initial revision
25 * */
26 /* Revision 1.2 1996/03/14 22:30:22 jaf */
27 /* Just rearranged the comments and local variable declarations a bit. */
29 /* Revision 1.1 1996/02/07 14:47:53 jaf */
30 /* Initial revision */
33 /* ********************************************************************* */
35 /* Find median of three values */
37 /* Input: */
38 /* D1,D2,D3 - Three input values */
39 /* Output: */
40 /* MEDIAN - Median value */
42 integer median_(integer *d1, integer *d2, integer *d3)
44 /* System generated locals */
45 integer ret_val;
47 /* Arguments */
48 ret_val = *d2;
49 if (*d2 > *d1 && *d2 > *d3) {
50 ret_val = *d1;
51 if (*d3 > *d1) {
52 ret_val = *d3;
54 } else if (*d2 < *d1 && *d2 < *d3) {
55 ret_val = *d1;
56 if (*d3 < *d1) {
57 ret_val = *d3;
60 return ret_val;
61 } /* median_ */