Division causes ceiling and therefore loss of precision. In the other hand multiplication does not. In the following situations you can rearange the equation to use multiplication instead of division.
The fee parameter need to be validated since otherwise you may allow it to be 0 fee. And fee that is over 100% for example is also probably a mistake that can happen with the decimals.
QA Report
Table of content
QA Findings
Multiplication instead division in compares
Division causes ceiling and therefore loss of precision. In the other hand multiplication does not. In the following situations you can rearange the equation to use multiplication instead of division.
Missing fee parameter validation
The fee parameter need to be validated since otherwise you may allow it to be 0 fee. And fee that is over 100% for example is also probably a mistake that can happen with the decimals.