Skip to content

Commit 780cfc7

Browse files
authored
Update 705-math-absmax.markdown
1 parent 321aaf3 commit 780cfc7

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed
Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
# ABSMAX
22

3-
> ABSMAX (...)
3+
> f = ABSMAX (var1 [, var2, ... , varN] )
44
5-
Returns the absolute max value of x.
5+
Returns the absolute maximum value of `var1` to `varN`. `var1` to `varN` can be numbers and arrays of numbers.
66

7-
```
8-
' absmax of three values
9-
print absmax(-3,-1,2)
7+
### Example 1: ABSMAX of several numbers
108

11-
' absmax of three variables
9+
```
1210
a = -3
1311
b = -1
1412
c = 2
15-
print absmax(a,b,c)
13+
print absmax(a, b, c) ' Output: 3
14+
```
15+
16+
### Example 2: ABSMAX of an array
17+
18+
```
19+
a = [-3,-1,2]
20+
print absmax(a) ' Output: 3
21+
```
1622

17-
' absmax of an array
23+
### Example 3: ABSMAX of mixed parameters
24+
25+
```
1826
a = [-3,-1,2]
19-
print absmax(a)
27+
b = -2
28+
print absmax(a, b) ' Output: 3
2029
```

0 commit comments

Comments
 (0)