I'd recommend putting parentheses around parts of your formula so it's a bit clearer how it works too. the compiler is probably following the proper math rules, so it should work properly, but it makes it a bit more readable for others if you include parentheses.

also your formula is not exactly correct. the formula for parallel resistances is the inverse of the sum of the inverses of the individual resistances:

Code:
r = 1 / ((1 / r1) + (1 / r2) + (1 / r3));
hope this helps