fix hashing of rationals (#9264)

Fixes #9264, also replace `x*2.0^y` by faster `ldexp(x,y)`.
The `code_native` is different as well: `abs` does a `sar, add, xor` sequence (e.g. see [here](http://dustri.org/b/absolute-value-in-asm.html)), whereas the other does a more obvious `neg, cmovl`. No idea which is faster.