Implementation of high/low for SomeReal (#6570)

This commit is contained in:
Fabian Keller 2017-10-30 17:21:44 +01:00 • committed by Andreas Rumpf
commit badba83d38
2 changed files with 21 additions and 0 deletions

View file

@ -2076,6 +2076,9 @@ proc max*[T](x, y: T): T =
if y <= x: x else: y
{.pop.}
proc high*(T: typedesc[SomeReal]): T = Inf
proc low*(T: typedesc[SomeReal]): T = NegInf
proc clamp*[T](x, a, b: T): T =
## limits the value ``x`` within the interval [a, b]
##