You may have missed the point.
An old project manager of mine once found a new young team member using floats in some code he was writing. That manage said "If you think you need floating point to solve the problem then you don't understand the problem"
At the time we did not have hardware floating point on that system and floats were not needed anyway, our Coral compiler supported fixed point arithmetic.
Anyway I always thought that a corollary to that might be "If your really do need floating point to solve the problem, then you have a problem you won't understand". Which I came to think is more and more true over the years as I learned more about floating point.
If that makes little sense to you then do have a read of:
"What Every Computer Scientist Should Know About Floating-Point Arithmetic": https://www.itu.dk/~sestoft/bachelor/IEEE754_article.pdf
"What Every Programmer Should Know About Floating-Point Arithmetic" https://floating-point-gui.de/
From a purely mathematical perspective, forget about computers and IEE standards for a moment, it makes no sense to compare real numbers for equality. Consider: If I think of a real number between zero and one and ask you to guess it then the probability of you guessing the right number is zero. In as much as we can talk of a probability in that situation.
When it comes to comparing integers of different sizes and signedness then you have the possibility that values in one cannot even be represented by the possible values of the other. So comparing them makes no sense.
Now, if you the programmer know for sure that your u64 will never hold values bigger than your u32 by all means convert convert one to the other some how and compare them.