I just realized we can use f64 types even in a 32 bit machines with a bit of a performance trade-off. But, how is this achieved in Rust? Are two f32 types bundled together as a makeshift f64 type? Or something else going on behind the scenes?
Can someone explain how this is done without digging too deep into rust internals? (I'm still very new to Rust).
They're represented in exactly the same way they're represented on a 64-bit machine; they're a hardware feature going back to the math co-processor for the 386, which was released somewhere around 1987.
Floats have nothing to do with the bitness of the machine.
The actual binary-level representation is documented exhaustively in other places, like the Wikipedia page on the Double-precision floating-point format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With