With form fields complying with the Simplified Field Notation limitations you can use "-" operator for subtraction.
Custom JavaScript Calculation should provide all the needed ability to create almost any calculation.
How to do (not so simple) form calculations by Thom Parker