mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
math: move the math.mathutil
generic min
/max
/abs
fns to math
(#13042)
This commit is contained in:
@ -61,24 +61,6 @@ pub fn digits(_n int, base int) []int {
|
||||
return res
|
||||
}
|
||||
|
||||
// max returns the maximum value of the two provided.
|
||||
[inline]
|
||||
pub fn max(a f64, b f64) f64 {
|
||||
if a > b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// min returns the minimum value of the two provided.
|
||||
[inline]
|
||||
pub fn min(a f64, b f64) f64 {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// minmax returns the minimum and maximum value of the two provided.
|
||||
pub fn minmax(a f64, b f64) (f64, f64) {
|
||||
if a < b {
|
||||
|
Reference in New Issue
Block a user