## gmt math MAX

Could you please give a simple example for gmt math MAX please? I've tried different things but can't seem to get function MAX working. e.g., echo '2 3' | gmt math -T MAX =

Thank you!

### Replies (2)

#### RE: gmt math MAX - Added by Paul 2 months ago

MAX takes two args so something like this

gmt math -Q 2 3 MAX =

If you instead need to find the largest value of a bunch of values: gmtmath works on columns so put your values in a file with one column, e.g., stuff.txt, then use

gmt math stuff.txt UPPER =

which will write the UPPER value once per row. If you just want to know what it is you can suppress all but the first row:

gmt math -Sf stuff.txt UPPER =

(1-2/2)