-8

I'm trying to make a VST Plugin and I saw a dash before a variable like this:

*output = fmax(*input,-mTreshhold);

I've searched in google but I couldn't find anything about it. Can someone explain what that dash does?

jub0bs
  • 54,300
  • 24
  • 162
  • 166
nosy
  • 3
  • 3
  • 10
    It's a negative sign. –  May 21 '16 at 17:56
  • 1
    Please read one of the books in the introductory section [here](http://stackoverflow.com/q/388242/2069064). They will help you a lot more at this time than SO. – Barry May 21 '16 at 18:02

3 Answers3

2

Feels kind of obvious since I had math in school: it's just the negative sign. fmax is called with 0-mThreshold as second parameter.

Marcus Müller
  • 31,250
  • 4
  • 47
  • 86
1

It's a unary minus operator, which is an arithmetic operator. It calculates the negative of its operand. For unsigned a, the value of -a is 2b -a, where b is the number of bits after promotion.

More information about all arithmetic operators here.

Leandros
  • 16,612
  • 9
  • 69
  • 105
0

The dash symbol before a variable or numeric constant negates the value.

The equivalent expression is:

*output = fmax(*input, 0 - mThreshhold);
Thomas Matthews
  • 54,980
  • 14
  • 94
  • 148