-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathclip.json
More file actions
82 lines (82 loc) · 2.27 KB
/
clip.json
File metadata and controls
82 lines (82 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
"id": "clip",
"summary": "Clip a value between a minimum and a maximum",
"description": "Clips a number between specified minimum and maximum values. A value larger than the maximum value is set to the maximum value, a value lower than the minimum value is set to the minimum value. If the maximum value is smaller than the minimum number, the process throws a `MinMaxSwapped` exception.\n\nNo-data values are passed through.",
"categories": [
"math"
],
"parameters": [
{
"name": "x",
"description": "A number.",
"schema": {
"type": [
"number",
"null"
]
}
},
{
"name": "min",
"description": "Minimum value. If the value is lower than this value, the process will return the value of this parameter.",
"schema": {
"type": "number"
}
},
{
"name": "max",
"description": "Maximum value. If the value is greater than this value, the process will return the value of this parameter.",
"schema": {
"type": "number"
}
}
],
"returns": {
"description": "The value clipped to the specified range.",
"schema": {
"type": [
"number",
"null"
]
}
},
"exceptions": {
"MinMaxSwapped": {
"message": "The minimum value should be lower than or equal to the maximum value."
}
},
"examples": [
{
"arguments": {
"x": -5,
"min": -1,
"max": 1
},
"returns": -1
},
{
"arguments": {
"x": 10.001,
"min": 1,
"max": 10
},
"returns": 10
},
{
"arguments": {
"x": 0.000001,
"min": 0,
"max": 0.02
},
"returns": 0.000001
},
{
"arguments": {
"x": null,
"min": 0,
"max": 1
},
"returns": null
}
]
}