Resistance and Damage Reduction - which order?

In which order are Resistance and Damage Reduction applied?
First Resistance and then Damage Reduction would be nice, since there is a greater gain.
But since DD mostly rounds in the direction which benefits monsters, it could be the other way around.
First Resistance and then Damage Reduction would be nice, since there is a greater gain.
But since DD mostly rounds in the direction which benefits monsters, it could be the other way around.