blob: 55bcff2b74dcaaacc340d0293361707b3ee1af60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
module math
// Returns the absolute value.
[inline]
pub fn abs(x f64) f64 {
if x > 0.0 {
return x
}
return -x
}
[inline]
pub fn fabs(x f64) f64 {
if x > 0.0 {
return x
}
return -x
}
|