A word to describe the act to switch between positive and negative?
I am doing some programming with math. I have written a tidy function which turns any positive number to negative or any negative number to a positive.
I would like to name this function in the most informative way so that if someone else were to look at my function; they would understand, straight away, what it does (and expect what it says on the tin).
The best word I can come up with is 'flip' but I feel that it fails at being obvious.
The function belongs to the Math object so it looks like this:
answer = Math.flip(number)
The results might be
-1 = Math.flip(1)
or
1 = Math.flip(-1)
How can I best describe this act?
Solution 1:
invert
verb
1.3 chiefly Mathematics Subject to inversion; transform into its inverse.
(oxforddictionaries.com)
but it has lots of meanings in maths. More precisely, it is the Additive Inverse
the additive inverse of a number a is the number that, when added to a, yields zero
and not to be confused with Multiplicative Inverse
a multiplicative inverse or reciprocal for a number x, denoted by 1/x or x−1, is a number which when multiplied by x yields the multiplicative identity, 1
(wikipedia)
So... err... invert additively? It's not very good, sorry.