Implementation of high/low for SomeReal (#6570)
This commit is contained in:
parent
0895064983
commit
badba83d38
2 changed files with 21 additions and 0 deletions
|
|
@ -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]
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue