implementation of signum