// ds_list_max(id)
// Returns the largest real in a list of reals
var L, size, result, i;
L = argument0;
if (ds_list_size(L) == 0) {
show_error('Cannot take the max of an empty list', 0);
return -1;
}
size = ds_list_size(L);
result = ds_list_find_value(L, 0);
for (i = 1; i < size; i += 1)
result = max(result, ds_list_find_value(L, i));
return result;
Categories: Data processing, Mathematics
There are no comments to display.
You must be signed in to post comments.