有没有更好的方法来计算两次双打的平均值?我该如何改进/纠正下面的代码?
double original_one, original_two; // can be any double >= 0
double used_one = original_one;
double used_two = original_two;
if ( original_one == 0 ) used_one = 1;
if ( original_two == 0 ) used_two = 1;
double average = used_one * used_two / 2; // average!