fix up numeric_representation_cast_impl

This implementation is slightly more correct, I believe.