8 lines
82 B
C
8 lines
82 B
C
|
template<typename T>
|
||
|
T abs(T x) {
|
||
|
if (x < 0) {
|
||
|
return -x;
|
||
|
}
|
||
|
return x;
|
||
|
}
|