diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-05-04 16:02:50 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-05-04 16:02:50 +0200 |
commit | 764cc0217735454c166cb7dd490db58f5fa6fe26 (patch) | |
tree | 63633b39ae24815e8b677ccbc9bac2cb01c39d3b /lib/system.nim | |
parent | afa80092d378a6dbc116c0aa3ed3964fd8c599d6 (diff) | |
parent | c1aa973758a60d7ef0e698c94861b74132612de5 (diff) | |
download | Nim-764cc0217735454c166cb7dd490db58f5fa6fe26.tar.gz |
Merge branch 'devel' into araq
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 82d3bb7f7..9b41253cc 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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 = |