don't use equals in sign and abs because it can be very slow