Fix rounding errors with fractional powers.

Alternative fix to #2069.