27.38 Maximum

Maximum( obj1, obj2.. )
Maximum( list )

Maximum returns the maximum of its arguments, i.e., that argument obj_i for which obj_k <= obj_i for all k. In its second form Maximum takes a list list and returns the maximum of the elements of this list.

Typically the arguments or elements of the list respectively will be integers, but actually they can be objects of an arbitrary type. This works because any two objects can be compared using the < operator.

    gap> Maximum( -123, 700, 123, 0, -1000 );
    700
    gap> Maximum( [ -123, 700, 123, 0, -1000 ] );
    700
    gap> Maximum( [ 1, 2 ], [ 0, 15 ], [ 1, 5 ], [ 2, -11 ] );
    [ 2, -11 ]        # lists are compared elementwise 

Previous Up Top Next
Index

GAP 3.4.4
April 1997