mirror of
https://github.com/vlang/v.git
synced 2025-09-10 16:00:31 -04:00
builtin: make int_min/2 and int_max/2 public
This commit is contained in:
parent
e72c9d0e87
commit
3544d3c144
@ -620,13 +620,13 @@ fn _Atomic__int_str(x int) string {
|
|||||||
// int_min returns the smallest `int` of input `a` and `b`.
|
// int_min returns the smallest `int` of input `a` and `b`.
|
||||||
// Example: assert int_min(2,3) == 2
|
// Example: assert int_min(2,3) == 2
|
||||||
@[inline]
|
@[inline]
|
||||||
fn int_min(a int, b int) int {
|
pub fn int_min(a int, b int) int {
|
||||||
return if a < b { a } else { b }
|
return if a < b { a } else { b }
|
||||||
}
|
}
|
||||||
|
|
||||||
// int_max returns the largest `int` of input `a` and `b`.
|
// int_max returns the largest `int` of input `a` and `b`.
|
||||||
// Example: assert int_max(2,3) == 3
|
// Example: assert int_max(2,3) == 3
|
||||||
@[inline]
|
@[inline]
|
||||||
fn int_max(a int, b int) int {
|
pub fn int_max(a int, b int) int {
|
||||||
return if a > b { a } else { b }
|
return if a > b { a } else { b }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user