Fix #7387, operations between ranges and non-real numbers

This seems pretty trivial, but it occurs to me that it would be nice to have generic fallbacks for these functions for all AbstractArrays so that it's not necessary to reimplement them for user-defined types. In that case we would presumably want to use `similar` instead of comprehensions, but then there's the problem of getting the element type right, which is ultimately related to how we decide to handle #7258. So for now, I'm punting on that and just making the minimal change to fix this issue.