GRASS 8 Programmer's Manual
8.6.0dev(2026)-55de52a352
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
* SPDX-FileCopyrightText: 1994 H. Mitasova (University of Illinois)
6
* SPDX-FileCopyrightText: 1994 L. Mitas (University of Illinois)
7
* SPDX-FileCopyrightText: 1994 I. Kosinovsky (USA-CERL)
8
* SPDX-FileCopyrightText: 1994 D.Gerdes (USA-CERL)
9
* SPDX-FileCopyrightText: GRASS Development Team
10
* SPDX-License-Identifier: GPL-2.0-or-later
11
*
12
* modified by McCauley in August 1995
13
* modified by Mitasova in August 1995
14
*
15
*/
16
17
#include <
stdio.h
>
18
#include <math.h>
19
20
int
min1
(
int
arg1
,
int
arg2
)
21
{
22
int
res;
23
24
if
(
arg1
<=
arg2
) {
25
res =
arg1
;
26
}
27
else
{
28
res =
arg2
;
29
}
30
return
res;
31
}
32
33
int
max1
(
34
/*
35
* L. Mitas (University of Illinois),
36
* I. Kosinovsky, (USA-CERL), and D.Gerdes (USA-CERL)
37
*
38
* modified by McCauley in August 1995
39
* modified by Mitasova in August 1995
40
*
41
*/
42
int
arg1
,
int
arg2
)
43
{
44
int
res;
45
46
if
(
arg1
>=
arg2
) {
47
res =
arg1
;
48
}
49
else
{
50
res =
arg2
;
51
}
52
return
res;
53
}
54
55
double
amax1
(
double
arg1
,
double
arg2
)
56
{
57
double
res;
58
59
if
(
arg1
>=
arg2
) {
60
res =
arg1
;
61
}
62
else
{
63
res =
arg2
;
64
}
65
return
res;
66
}
67
68
double
amin1
(
double
arg1
,
double
arg2
)
69
{
70
double
res;
71
72
if
(
arg1
<=
arg2
) {
73
res =
arg1
;
74
}
75
else
{
76
res =
arg2
;
77
}
78
return
res;
79
}
AMI_STREAM
Definition
ami_stream.h:153
amax1
double amax1(double arg1, double arg2)
Definition
minmax.c:55
min1
int min1(int arg1, int arg2)
Definition
minmax.c:20
max1
int max1(int arg1, int arg2)
Definition
minmax.c:33
amin1
double amin1(double arg1, double arg2)
Definition
minmax.c:68
stdio.h
lib
rst
interp_float
minmax.c
Generated on Thu Sep 10 2026 06:57:38 for GRASS 8 Programmer's Manual by
1.9.8