damage = [a.atk * 4 - b.def * 2, x].max
Where "x" = the minimum damage you want that attack to ever do.
This can be useful for attacks that you want to do a minimum amount of damage, no matter what the enemy defense is.
For example: An attack that will NEVER do less than 100 damage:
damage = [a.atk * 4 - b.def * 2, 100].max