mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-16 16:14:20 +00:00
Added generic min/max versions for two arguments (#5734)
This commit is contained in:
committed by
Andreas Rumpf
parent
0055729755
commit
2242307c17
@@ -2016,6 +2016,12 @@ proc min*(x, y: float): float {.magic: "MinF64", noSideEffect.} =
|
||||
if x <= y: x else: y
|
||||
proc max*(x, y: float): float {.magic: "MaxF64", noSideEffect.} =
|
||||
if y <= x: x else: y
|
||||
|
||||
proc min*[T](x, y: T): T =
|
||||
if x <= y: x else: y
|
||||
|
||||
proc max*[T](x, y: T): T =
|
||||
if y <= x: x else: y
|
||||
{.pop.}
|
||||
|
||||
proc clamp*[T](x, a, b: T): T =
|
||||
|
||||
Reference in New Issue
Block a user