Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As another option, you can define side as follows:

side(u) = 2*unit_step(u) - 1

Hence

sage: [side(a) for a in range(-2,3)]
[-1, -1, 1, 1, 1]