fix hashing of rationals (#9264)

Fixes #9264, also replace `x*2.0^y` by faster `ldexp(x,y)`.
They don't produce the same code in any case:

```jl
julia> @code_llvm abs(10)

define i64 @"julia_abs;42426"(i64) {
top:
  %1 = ashr i64 %0, 63, !dbg !854
  %2 = add i64 %1, %0, !dbg !854
  %3 = xor i64 %2, %1, !dbg !854
  ret i64 %3, !dbg !854
}

julia> @code_llvm myabs(10)

define i64 @"julia_myabs;42432"(i64) {
top:
  %1 = icmp sgt i64 %0, -1, !dbg !872
  %2 = sub i64 0, %0, !dbg !872
  %3 = select i1 %1, i64 %0, i64 %2, !dbg !872
  ret i64 %3, !dbg !872
}