Fix evil bug in floating-point arithmetic and strengthen test code.

When rounding up, the error bound sometimes came out as 1/2 ulp instead of 1 ulp due to the mantissa rounding up to the next power of two, without a corresponding exponent correction. Fortunately, this should not affect ball arithmetic (which always rounds down).