Cost price (CP) is what you pay, selling price (SP) is what you receive. Gain and loss percentages are always calculated on the CP unless stated otherwise.
1Basics
Gain = SP − CP, Loss = CP − SP
Gain % = (Gain × 100)/CP, Loss % = (Loss × 100)/CP
SP = CP × (100 + Gain%)/100, SP = CP × (100 − Loss%)/100
CP = SP × 100/(100 + Gain%), CP = SP × 100/(100 − Loss%)
2Discounts and tricks
Marked up m% and discounted d%: net gain % = m − d − md/100
Two articles sold at the same price, one at x% gain and one at x% loss: loss of x²/100 %
False weight: gain % = (error/(true value − error)) × 100