rpmdoestuff's blog

By rpmdoestuff, history, 15 months ago, In English

If you want a variable to be the negative of itself, do you use n = -n, n *= -1, or other methods? If so, suggest some methods down below.

  • Vote: I like it
  • -32
  • Vote: I do not like it

| Write comment?
»
15 months ago, # |
  Vote: I like it +10 Vote: I do not like it

Why does it matter too much?

  • »
    »
    15 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It's a serious debate, as the title of the blog says

»
15 months ago, # |
  Vote: I like it +27 Vote: I do not like it

n = n*(6968-6969)

»
15 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

How about n = ~n?

»
15 months ago, # |
  Vote: I like it +3 Vote: I do not like it

n = binary_exponentiate(-1,69)*n

»
15 months ago, # |
  Vote: I like it 0 Vote: I do not like it

n=+-n is the best