GRASS 8 Programmer's Manual
8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
minmax.c
Go to the documentation of this file.
1
/*-
2
* Written by H. Mitasova, L. Mitas, I. Kosinovsky, D. Gerdes Fall 1994
3
* University of Illinois
4
* US Army Construction Engineering Research Lab
5
* Copyright 1994, H. Mitasova (University of Illinois),
6
* L. Mitas (University of Illinois),
7
* I. Kosinovsky, (USA-CERL), and D.Gerdes (USA-CERL)
8
*
9
* modified by McCauley in August 1995
10
* modified by Mitasova in August 1995
11
*
12
*/
13
14
#include <
stdio.h
>
15
#include <math.h>
16
17
int
min1
(
int
arg1
,
int
arg2
)
18
{
19
int
res;
20
21
if
(
arg1
<=
arg2
) {
22
res =
arg1
;
23
}
24
else
{
25
res =
arg2
;
26
}
27
return
res;
28
}
29
30
int
max1
(
31
/*
32
* L. Mitas (University of Illinois),
33
* I. Kosinovsky, (USA-CERL), and D.Gerdes (USA-CERL)
34
*
35
* modified by McCauley in August 1995
36
* modified by Mitasova in August 1995
37
*
38
*/
39
int
arg1
,
int
arg2
)
40
{
41
int
res;
42
43
if
(
arg1
>=
arg2
) {
44
res =
arg1
;
45
}
46
else
{
47
res =
arg2
;
48
}
49
return
res;
50
}
51
52
double
amax1
(
double
arg1
,
double
arg2
)
53
{
54
double
res;
55
56
if
(
arg1
>=
arg2
) {
57
res =
arg1
;
58
}
59
else
{
60
res =
arg2
;
61
}
62
return
res;
63
}
64
65
double
amin1
(
double
arg1
,
double
arg2
)
66
{
67
double
res;
68
69
if
(
arg1
<=
arg2
) {
70
res =
arg1
;
71
}
72
else
{
73
res =
arg2
;
74
}
75
return
res;
76
}
AMI_STREAM
Definition
ami_stream.h:153
amax1
double amax1(double arg1, double arg2)
Definition
minmax.c:52
min1
int min1(int arg1, int arg2)
Definition
minmax.c:17
max1
int max1(int arg1, int arg2)
Definition
minmax.c:30
amin1
double amin1(double arg1, double arg2)
Definition
minmax.c:65
stdio.h
lib
rst
interp_float
minmax.c
Generated on Fri Apr 3 2026 06:59:56 for GRASS 8 Programmer's Manual by
1.9.8