mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
@ -18,5 +18,5 @@ pub fn max<T>(a T, b T) T {
|
||||
// abs returns the absolute value of `a`
|
||||
[inline]
|
||||
pub fn abs<T>(a T) T {
|
||||
return if a > 0 { a } else { -a }
|
||||
return if a < 0 { -a } else { a }
|
||||
}
|
||||
|
Reference in New Issue
Block a user