You are right for the first one but the second question isn't clear to me , is it "Divide profit by share and subtract 1000 from the resultant" or "Divide profit by (shares - 1000) ".If it's the second then you did correct.
If you need to subtract 1000 after, you'd have to do some algebraic manipulation to get that.
1 2
//math:
a/b - c == (a - bc)/b
Kinda pointless, in actual code just make it a 2-liner...
Edit: Oh wait nevermind it's not possible in one line by the looks of it, since you'd have to have profit be by itself on the numerator to work.
Just make it a two liner
edit :This probably falls under undefined behavior see post below.
I don't know why I had in my mind that there would be a sequence point at the end of the bracket.
edit 2 : It isn't undefined ... I ran it ... it is clearly defined ...