get_shared_numeric_sign

mathtools.get_shared_numeric_sign(sequence)

Gets shared numeric sign of elements in sequence.

Returns 1 when all sequence elements are positive:

>>> mathtools.get_shared_numeric_sign([1, 2, 3])
1

Returns -1 when all sequence elements are negative:

>>> mathtools.get_shared_numeric_sign([-1, -2, -3])
-1

Returns 0 on empty sequence:

>>> mathtools.get_shared_numeric_sign([])
0

Otherwise returns none:

>>> mathtools.get_shared_numeric_sign([1, 2, -3]) is None
True

Returns 1, -1, 0 or none.