https://en.wikichip.org/wiki/mirc/variables#Math_Operations
The math works only if there are exactly 2 terms and 1 math operator, so if you have 3 numbers to add together you need to put them inside $calc( )
If you want it to put the literal string without doing the math, you need the -p switch
If you are adding 2 variables together and need to defend against one of them being blank, you'd need to do like

var %a 0 $+ %num1 + 0 $+ %num2
In addition to the + operator, this also works with - * / % ^