repo.or.cz
/
quarnos.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
net: tcp_client_socket connection state routines
[quarnos.git]
/
libs
/
math.h
blob
77ce9ce31630895e24c68aa1f206ea69b849fdc3
1
#ifndef _MATH_H_
2
#define _MATH_H_
3
4
namespace
math
{
5
6
template
<
typename T
>
7
static
inline
T
min
(
T x
,
T y
) {
8
return
x
<
y
?
x
:
y
;
9
}
10
11
template
<
typename T
>
12
static
inline
T
max
(
T x
,
T y
) {
13
return
x
>
y
?
x
:
y
;
14
}
15
16
template
<
typename T
>
17
static
inline
T
abs
(
T x
) {
18
return
x
>
0
?
x
: -
x
;
19
}
20
21
}
22
23
#endif