Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't force 0 left power balance on 0 power #81
Technically, a zero total power results in a divide-by-zero, so there is not valid correct result. We were defaulting, in this case, to zero left-balance, but this doesn't really make any more sense than any other value. Now, we default to 50% left power if both left and right are equal (ie left os 50% of 0, and right is 50% of 0), which makes a lot more sense visually (eg when rendered in an application). We now also handle special case where left and right might be equally opposite in sign (eg -10 and +10), which still results in a zero total power. So here, we use a left-balance of 0 or 100%, if the left is the lesser (negative) or greater (positive) of the two respectively.
- Loading branch information