fixed Math::sign to actually return the sign of the number