faster hashing by avoiding UB
In LLVM (inherited from C), fptosi has undefined behavior if the result
does not fit the integer size after rounding down. But by using the same
strategy as generic hashing of Real values, we actually can end up with
a sitatuion that is faster for the CPU to deal with and avoids the UB.
Refs #6624 (36969687fb9bbd936b3adc0baa6cf0a408d2ccb7)
Fixes #37800