add an example using default arguments of clamp

This commit is contained in:
tiwo 2017-06-18 15:09:48 +02:00
parent 4bae3f5589
commit 91de0cb298
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,8 @@ def clamp(x, lower=float('-inf'), upper=float('inf')):
0 0
>>> clamp(101.0, 0, 5) >>> clamp(101.0, 0, 5)
5 5
>>> clamp(123, upper=5)
5
Similar to `numpy's clip`_ function. Similar to `numpy's clip`_ function.