tracts.util.all_same_sign#

all_same_sign(lst)#

Check whether all elements in a list have the same sign.

Parameters:

lst (list[Number]) – List of numeric values. Raises error if empty.

Returns:

True if all elements have the same sign as the first element, False otherwise.

Return type:

bool